Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ranged buff skips instances that are not available to creature #3660

Closed
wants to merge 1 commit into from

Conversation

Loobinex
Copy link
Member

Hopefully fixes this crash that sometimes happens even though I have no active ranged-buff spells:

Sync: [400] creature_explore_dungeon: The creature FLY owned by player 0 can't navigate to subtile (22,178) for exploring
=== Crash ===
Error: Attempt of integer division by zero.
[#15] keeperfx.exe : search_target_ranged_heal            [0x48b970+0xbd]     map lookup for: 0023:0014ba2d, base: 000c0000
[#14] keeperfx.exe : process_creature_ranged_buff_spell_casting [0x48d7d0+0xfc]     map lookup for: 0023:0014d8cc, base: 000c0000
[#13] keeperfx.exe : update_creature                      [0x5c5cc0+0x528]     map lookup for: 0023:002861e8, base: 000c0000

@Loobinex
Copy link
Member Author

I found out I do in fact have a creature on the map with ranged abilities, which would explain the crash.
Evan, still a good idea to check here, or do you think it would not make sense?

@Linvail
Copy link
Contributor

Linvail commented Nov 11, 2024

The only division used in search_target_ranged_heal() is to dividing max_health, which is not supposed to be zero.
If the max_health is zero, some bugs occurs elsewhere.

@Loobinex
Copy link
Member Author

The only division used in search_target_ranged_heal() is to dividing max_health, which is not supposed to be zero. If the max_health is zero, some bugs occurs elsewhere.

This would occur when you place a custom creature on a map that the game does not recognize. (So, creature type ID 33 on a map with 32 creature type IDs).

@Loobinex Loobinex closed this Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants