The Mossmouth Forums

Games => Bugs/Suggestions => Topic started by: DariusK on January 07, 2010, 02:44:23 PM



Title: Bug (Rare): When Player Has Lots of Health, Spear Trap Hit Records Bad Stats
Post by: DariusK on January 07, 2010, 02:44:23 PM
When a player has a lot of health (technically all you need is more than 4 health although this bug is a lot easier to test with 99 health) and they get hit by a spear trap, they won't die (as the spear trap is not an insta-kill), but the hit will be recorded as a death by spear trap in stats.txt.

Here's the relevant code where the bug is (oPlayer1, Step Event, Action 3, line 153):

Code:
       if (global.plife > 0 and isRealLevel())  global.miscDeaths[7] += 1;

The corrected code should read

Code:
       if (global.plife <= 0 and isRealLevel())  global.miscDeaths[7] += 1;

Also, this code needs to be moved down a few lines, after the line that reduces the player's health by 4. This will record the death stat only if the player actually died.

Further note: the same bug exists in line 136 in the code for being hurt by explosions. Looks like a copy-paste.


Title: Re: Bug (Rare): When Player Has Lots of Health, Spear Trap Hit Records Bad Stats
Post by: marsgreekgod on January 07, 2010, 02:49:20 PM
that is kinda intersting.


Title: Re: Bug (Rare): When Player Has Lots of Health, Spear Trap Hit Records Bad Stats
Post by: gummybears123 on January 07, 2010, 06:29:38 PM
Very interesting indeed, DariusK are you a programmer?


Title: Re: Bug (Rare): When Player Has Lots of Health, Spear Trap Hit Records Bad Stats
Post by: marsgreekgod on January 07, 2010, 06:31:13 PM
He clams to be so in his blog, and has seemed to back it up at least in game maker.


Title: Re: Bug (Rare): When Player Has Lots of Health, Spear Trap Hit Records Bad Stats
Post by: DariusK on January 07, 2010, 06:33:35 PM
Very interesting indeed, DariusK are you a programmer?
I do some programming, yeah! I'm not like professional-quality or anything but I've been modding Spelunky for a while now (see SpelunkyTweet (http://tinysubversions.com/2009/06/game-maker-and-twitter-united-in-spelunky/), my last mod).


Title: Re: Bug (Rare): When Player Has Lots of Health, Spear Trap Hit Records Bad Stats
Post by: gummybears123 on January 07, 2010, 06:35:18 PM
Good, the more programmers, the better ;D


Title: Re: Bug (Rare): When Player Has Lots of Health, Spear Trap Hit Records Bad Stats
Post by: marsgreekgod on January 07, 2010, 06:36:12 PM
That is interesting... very interesting. I must see this thing.

You might be the person we have been seeking, but that is not of this topic.