git: 9front

Download patch

ref: d1f3968dfd088aaec92e523bec00d4abeb4d0a73
parent: 4864cf02d6c6f52ff9c6403e48b07ed8f00c0860
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Jul 30 16:00:43 EDT 2015

games/doom: fix ouchface not being shown when it should be (thanks qu7uux)

due to a typo in st_stuff.c:ST_updateFaceWidget(), doomguy mistakenly never
looks shocked when taking more than 20 damage, but rather when he gains more
than 20 health while being hit.
this is a cosmetic bug in all old versions of doom's executables, but it seems
appropriate to fix.
simple test: fire a rocket at a nearby wall, taking enough damage.

--- a/sys/src/games/doom/st_stuff.c
+++ b/sys/src/games/doom/st_stuff.c
@@ -801,7 +801,7 @@
 	    // being attacked
 	    priority = 7;
 	    
-	    if (plyr->health - st_oldhealth > ST_MUCHPAIN)
+	    if (st_oldhealth - plyr->health > ST_MUCHPAIN)
 	    {
 		st_facecount = ST_TURNCOUNT;
 		st_faceindex = ST_calcPainOffset() + ST_OUCHOFFSET;
@@ -854,7 +854,7 @@
 	// getting hurt because of your own damn stupidity
 	if (plyr->damagecount)
 	{
-	    if (plyr->health - st_oldhealth > ST_MUCHPAIN)
+	    if (st_oldhealth - plyr->health > ST_MUCHPAIN)
 	    {
 		priority = 7;
 		st_facecount = ST_TURNCOUNT;
--