From 8e40b85cfa6e0251eb65a5d386d0512faff7775b Mon Sep 17 00:00:00 2001 From: hnt_ts Date: Fri, 30 May 2008 22:45:43 +0000 Subject: [PATCH] The ifpdistl and ifpdistg commands are fixed now. git-svn-id: https://svn.eduke32.com/eduke32@746 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 8 +++++--- polymer/eduke32/source/game.c | 14 ++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index a52cbdacf..2bf8d9dfa 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -548,9 +548,9 @@ void deletespriteEVENT(int s) if (apScriptGameEvent[EVENT_KILLIT]) { int p; - + int pl=findplayer(&sprite[s],(int *)&p); SetGameVarID(g_iReturnVarID,0, -1, -1); - OnEvent(EVENT_KILLIT, s, findplayer(&sprite[s],(int *)&p), p); + OnEvent(EVENT_KILLIT, s, pl, p); if (GetGameVarID(g_iReturnVarID, -1, -1)) return; } @@ -7589,8 +7589,10 @@ void moveobjects(void) i = headspritestat[k]; while (i >= 0) { + int pl; j = nextspritestat[i]; - OnEvent(EVENT_GAME,i, findplayer(&sprite[i],(int *)&p), p); + pl=findplayer(&sprite[i],(int *)&p); + OnEvent(EVENT_GAME,i, pl, p); i = j; } } diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 253c43989..274b47aa0 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -4416,8 +4416,11 @@ int EGS(int whatsect,int s_x,int s_y,int s_z,int s_pn,int s_s,int s_xr,int s_yr, ResetActorGameVars(i); hittype[i].flags = 0; - if (apScriptGameEvent[EVENT_EGS]) - OnEvent(EVENT_EGS,i, findplayer(&sprite[i],&p), p); + { + int pl=findplayer(&sprite[i],&p); + if (apScriptGameEvent[EVENT_EGS]) + OnEvent(EVENT_EGS,i, pl, p); + } return(i); } @@ -6345,8 +6348,11 @@ int spawn(int j, int pn) break; } - if (apScriptGameEvent[EVENT_SPAWN]) - OnEvent(EVENT_SPAWN,i, findplayer(&sprite[i],&p), p); + { + int pl=findplayer(&sprite[i],&p); + if (apScriptGameEvent[EVENT_SPAWN]) + OnEvent(EVENT_SPAWN,i, pl, p); + } return i; }