kdechant / eamon

A web port of the classic text adventure game, the Wonderful World of Eamon
https://eamon-remastered.com
MIT License
22 stars 5 forks source link

Crash 'Escape From The Orc Lair' #1

Closed MidiHax closed 7 years ago

MidiHax commented 7 years ago

eamon.terranok.com-1492211092251.log.txt

Browser log attached. Game went into bad state after crash and would no longer accept commands. Looks like crash happened after processing a monster fumble in one of the combat routines:

attack orc Sauron swings at Orc -- parried! Mork tears at Orc -- a fumble!

History ends.

Sauron is player character.

The offending line that threw the exception is: if (wpn.type === artifact_1.Artifact.TYPE_MAGIC_WEAPON) {

Mork (friendly) was attacking Orc (28 Group Monster). I can't tell from the code if wpn was NULL or if the artifact_1 var is NULL. Based on the combat verb (tears) I don't think Mork was using an artifact weapon but was using a natural weapon. Prior to the block of the crash, the code does null ref checking since it possible a monster is using natural weapons. I think your miss/fumble block in monster.js might need to check wpn for NULL and exit out since a natural weapon can't fumble... hope that helps!

Very nice work! Had fun playing this module!

kdechant commented 7 years ago

Thanks for the detailed report. I have seen errors before in the fumble routine, when a monster with natural weapons fumbles and the fumble roll is "damage weapon." I think that's what happened in this case. Shouldn't be too hard to fix.

kdechant commented 7 years ago

Fixed in commit faa2813.