Pages: [1]
  Print  
Author Topic: Bug (Rare): When Player Has Lots of Health, Spear Trap Hit Records Bad Stats  (Read 3504 times)
DariusK
Bulb
*
Posts: 97



View Profile WWW
« 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.
« Last Edit: January 07, 2010, 04:31:43 PM by DariusK » Logged

marsgreekgod
Big Bossy
Mossy
*
Posts: 9806


The will of the Galaxy.


View Profile WWW Email
« Reply #1 on: January 07, 2010, 02:49:20 PM »

that is kinda intersting.
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
gummybears123
Mossy
*
Posts: 5785


Yummy Gummy!


View Profile
« Reply #2 on: January 07, 2010, 06:29:38 PM »

Very interesting indeed, DariusK are you a programmer?
Logged

I made a rap.
It sounds dumb, like reading a map
I really should stop this thing before it goes too far
But I don't really car as long as I stay below the radar
Those big companies won't get me no
I'll get away before the fuzz show

-Most famous rapper of Mossmouth
Kirbylord
marsgreekgod
Big Bossy
Mossy
*
Posts: 9806


The will of the Galaxy.


View Profile WWW Email
« Reply #3 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.
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
DariusK
Bulb
*
Posts: 97



View Profile WWW
« Reply #4 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, my last mod).
Logged

gummybears123
Mossy
*
Posts: 5785


Yummy Gummy!


View Profile
« Reply #5 on: January 07, 2010, 06:35:18 PM »

Good, the more programmers, the better Grin
Logged

I made a rap.
It sounds dumb, like reading a map
I really should stop this thing before it goes too far
But I don't really car as long as I stay below the radar
Those big companies won't get me no
I'll get away before the fuzz show

-Most famous rapper of Mossmouth
Kirbylord
marsgreekgod
Big Bossy
Mossy
*
Posts: 9806


The will of the Galaxy.


View Profile WWW Email
« Reply #6 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.
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
Pages: [1]
  Print  
 
Jump to: