davewx7 / citadel

A turn based strategy game based on the Anura engine
Other
99 stars 25 forks source link

Assertion Failed in crypt.cfg:112, not entry.creature.is_land (caused by Oldric's Trap registering as 'attacker') #218

Closed Lucius4 closed 6 years ago

Lucius4 commented 6 years ago

I got this error during normal game against computer and similar when playing in the multiplayer mode.

obraz

ghost commented 6 years ago

In MP, opponent side crashes too:

screen shot 2018-06-03 at 10 34 15

Trying to reconnect doesn't help this one as it crashes again:

screen shot 2018-06-03 at 10 33 57

I don't know what is happening, but I think it's easy to fix once knowing what's happening.

sapientN3T commented 6 years ago

Thanks for this report, but it is very difficult to investigate without the game-log.txt. Please include the game-log and the server-log with all future bug reports.

Lucius4 commented 6 years ago

I hope it helps more.

game-log.txt server-log.txt

sapientN3T commented 6 years ago

hi @Lucius4 unfortunately those files did not contain the error, because you restarted the game so it overwrote the files.

However, based on my hunch that it was related to Oldric's Trap, I was able to reproduce it.

The problem is that when the creature code wants to fire on_kill, it does a lookup of the creature that killed it, get_creature_by_summon_id. however that is incorrect since it might have been killed by a land. it should call get_permanent_by_summon_id. so this assert detected a pre-existing code error. the land that kills in this case is Oldric's Trap.

That means that cards which rely on killed_by_this_turn to grant an effect to the killer (i.e. Yogi, Bounty, Heir to the Throne) need to consider that the killer might be a land! alternatively, maybe Oldric's Trap should just use inflict_damage instead of inflict_combat_damage

In the end, I decided that the simplest fix was to prevent lands from registering as the 'attacker', so it should be fixed now.