summaryrefslogtreecommitdiff
path: root/src/strife/p_inter.c
diff options
context:
space:
mode:
authorSamuel Villareal2010-09-18 07:05:42 +0000
committerSamuel Villareal2010-09-18 07:05:42 +0000
commitb335b29a98bf2f86fb66a385e913d5e013317e2a (patch)
tree66fc1e27cc0c451f18235e3356d9ddb2ac471609 /src/strife/p_inter.c
parent04a3bc8c48b80f979de8f4983eaa7093ca9fa11e (diff)
downloadchocolate-doom-b335b29a98bf2f86fb66a385e913d5e013317e2a.tar.gz
chocolate-doom-b335b29a98bf2f86fb66a385e913d5e013317e2a.tar.bz2
chocolate-doom-b335b29a98bf2f86fb66a385e913d5e013317e2a.zip
+ Change in P_DamageMobj due to fluke with specrtal checks
+ P_TouchSpecialThing updated to damage toucher if special's flag is spectral Subversion-branch: /branches/strife-branch Subversion-revision: 2106
Diffstat (limited to 'src/strife/p_inter.c')
-rw-r--r--src/strife/p_inter.c47
1 files changed, 15 insertions, 32 deletions
diff --git a/src/strife/p_inter.c b/src/strife/p_inter.c
index a41bdcec..d6a0a568 100644
--- a/src/strife/p_inter.c
+++ b/src/strife/p_inter.c
@@ -412,9 +412,16 @@ void P_TouchSpecialThing(mobj_t* special, mobj_t* toucher)
// Dead thing touching.
// Can happen with a sliding player corpse.
- if (toucher->health <= 0)
+ if(toucher->health <= 0)
return;
+ // villsa [STRIFE] damage toucher if special has spectral flag
+ if(special->flags & MF_SPECTRAL)
+ {
+ P_DamageMobj(toucher, NULL, NULL, 5);
+ return;
+ }
+
// villsa [STRIFE]
pickupmsg[0] = 0;
@@ -961,37 +968,14 @@ void P_DamageMobj(mobj_t* target, mobj_t* inflictor, mobj_t* source, int damage)
// notes on projectile health:
// -2 == enemy spectral projectile
// -1 == player spectral projectile
- if(target->flags & MF_SPECTRAL) // target is spectral
- {
- // check for these specific actors
- // seems a bit redundant since they already got the spectral flag
- // to check for this stuff
- if(target->type == MT_RLEADER2
- || target->type == MT_ORACLE
- || target->type == MT_SPECTRE_C)
- {
- // don't do damage if player has no sigil type
- if(source->player->sigiltype < 1)
- return;
- }
- if(inflictor)
- {
- // only spectral inflictors can damage other spectral actors
- if(!(inflictor->flags & MF_SPECTRAL))
- return;
-
- if(inflictor->health == -2) // don't damage itself
- return;
- }
- }
-
- // villsa [STRIFE] handle player's spectral projectile
- if(target->type == MT_PLAYER) // target is a player
- {
- if(inflictor && inflictor->flags & MF_SPECTRAL && inflictor->health == -1)
- return; // don't damage itself
- }
+ if(!(!inflictor ||
+ !(inflictor->flags & MF_SPECTRAL) ||
+ (target->type != MT_PLAYER || inflictor->health != -1) &&
+ (!(target->flags & MF_SPECTRAL) || inflictor->health != -2) &&
+ (target->type != MT_RLEADER2 && target->type != MT_ORACLE && target->type != MT_SPECTRE_C ||
+ (source->player->sigiltype) >= 1)))
+ return;
// villsa [STRIFE] new checks for various actors
if(inflictor)
@@ -1277,6 +1261,5 @@ void P_DamageMobj(mobj_t* target, mobj_t* inflictor, mobj_t* source, int damage)
&& target->info->seestate != S_NULL)
P_SetMobjState (target, target->info->seestate);
}
-
}