Replace "if (g_tile[..].execPtr)" -> "if (G_HaveActor(...))".

git-svn-id: https://svn.eduke32.com/eduke32@3344 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-12-29 15:21:28 +00:00
parent 80ee967b8e
commit 80f3e132b0
6 changed files with 34 additions and 16 deletions

View file

@ -1095,7 +1095,7 @@ ACTOR_STATIC void G_MovePlayers(void)
otherx = 0; otherx = 0;
} }
if (g_tile[sprite[i].picnum].execPtr) if (G_HaveActor(sprite[i].picnum))
A_Execute(i,s->yvel,otherx); A_Execute(i,s->yvel,otherx);
if (g_netServer || ud.multimode > 1) if (g_netServer || ud.multimode > 1)
@ -2386,7 +2386,7 @@ CLEAR_THE_BOLT:
case STEAM__STATIC: case STEAM__STATIC:
case CEILINGSTEAM__STATIC: case CEILINGSTEAM__STATIC:
case WATERBUBBLEMAKER__STATIC: case WATERBUBBLEMAKER__STATIC:
if (!g_tile[sprite[i].picnum].execPtr) if (!G_HaveActor(sprite[i].picnum))
goto BOLT; goto BOLT;
{ {
int32_t p = A_FindPlayer(s, &x); int32_t p = A_FindPlayer(s, &x);
@ -2772,7 +2772,7 @@ ACTOR_STATIC void G_MoveWeapons(void)
if (proj->workslike & PROJECTILE_HITSCAN) if (proj->workslike & PROJECTILE_HITSCAN)
{ {
if (!g_tile[sprite[i].picnum].execPtr) if (!G_HaveActor(sprite[i].picnum))
goto BOLT; goto BOLT;
{ {
int32_t p = A_FindPlayer(s,&x); int32_t p = A_FindPlayer(s,&x);
@ -3092,7 +3092,7 @@ COOLEXPLOSION:
goto BOLT; goto BOLT;
case SHOTSPARK1__STATIC: case SHOTSPARK1__STATIC:
if (!g_tile[sprite[i].picnum].execPtr) if (!G_HaveActor(sprite[i].picnum))
goto BOLT; goto BOLT;
{ {
int32_t p = A_FindPlayer(s,&x); int32_t p = A_FindPlayer(s,&x);
@ -4844,7 +4844,7 @@ DETONATEB:
} }
} }
if (!g_tile[sprite[i].picnum].execPtr) if (!G_HaveActor(sprite[i].picnum))
goto BOLT; goto BOLT;
{ {
int32_t p = A_FindPlayer(s,&x); int32_t p = A_FindPlayer(s,&x);
@ -5285,7 +5285,7 @@ ACTOR_STATIC void G_MoveMisc(void) // STATNUM 5
case TRANSPORTERSTAR__STATIC: case TRANSPORTERSTAR__STATIC:
case TRANSPORTERBEAM__STATIC: case TRANSPORTERBEAM__STATIC:
{ {
if (!g_tile[sprite[i].picnum].execPtr) if (!G_HaveActor(sprite[i].picnum))
goto BOLT; goto BOLT;
{ {
int32_t p = A_FindPlayer(s,&x); int32_t p = A_FindPlayer(s,&x);

View file

@ -145,6 +145,24 @@ static inline int32_t G_HaveEvent(int32_t iEventID)
apScriptGameEvent[iEventID]!=NULL; apScriptGameEvent[iEventID]!=NULL;
} }
static inline int32_t G_HaveActor(int32_t actortile)
{
return
#ifdef LUNATIC
El_HaveActor(actortile) ||
#endif
g_tile[actortile].execPtr!=NULL;
}
static inline int32_t G_InitialActorStrength(int32_t actortile)
{
#ifdef LUNATIC_ONLY
return g_elActors[actortile].strength;
#else
return g_tile[actortile].execPtr[0];
#endif
}
#ifdef EXTERNC #ifdef EXTERNC
} }
#endif #endif

View file

@ -4218,7 +4218,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
else switch (DYNAMICTILEMAP(sp->picnum)) else switch (DYNAMICTILEMAP(sp->picnum))
{ {
default: default:
if (g_tile[sp->picnum].execPtr) if (G_HaveActor(sp->picnum))
{ {
if (j == -1 && sp->lotag > ud.player_skill) if (j == -1 && sp->lotag > ud.player_skill)
{ {
@ -6744,7 +6744,7 @@ PALONLY:
break; break;
} }
if (g_tile[s->picnum].execPtr) if (G_HaveActor(s->picnum))
{ {
/* /*
if (ud.angleinterpolation) if (ud.angleinterpolation)

View file

@ -882,7 +882,7 @@ static void VM_Fall(void)
#endif #endif
if ((vm.g_sp->hitag & jumptoplayer) || if ((vm.g_sp->hitag & jumptoplayer) ||
(g_tile[vm.g_sp->picnum].execPtr && (G_HaveActor(vm.g_sp->picnum) &&
#ifndef LUNATIC #ifndef LUNATIC
(unsigned)moveScriptOfs < (unsigned)g_scriptSize-1 && script[moveScriptOfs + 1] (unsigned)moveScriptOfs < (unsigned)g_scriptSize-1 && script[moveScriptOfs + 1]
#else #else

View file

@ -1288,7 +1288,7 @@ DOSKIPBULLETHOLE:
if (p >= 0) if (p >= 0)
{ {
k = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,SHOTSPARK1,-15,10,10,sa,0,0,i,4); k = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,SHOTSPARK1,-15,10,10,sa,0,0,i,4);
sprite[k].extra = *g_tile[atwith].execPtr; sprite[k].extra = G_InitialActorStrength(atwith);
sprite[k].extra += (krand()%6); sprite[k].extra += (krand()%6);
sprite[k].yvel = atwith; // this is a hack to allow you to detect which weapon spawned a SHOTSPARK1 sprite[k].yvel = atwith; // this is a hack to allow you to detect which weapon spawned a SHOTSPARK1
A_SetHitData(k, &hit); A_SetHitData(k, &hit);
@ -1408,7 +1408,7 @@ SKIPBULLETHOLE:
else else
{ {
k = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,SHOTSPARK1,-15,24,24,sa,0,0,i,4); k = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,SHOTSPARK1,-15,24,24,sa,0,0,i,4);
sprite[k].extra = *g_tile[atwith].execPtr; sprite[k].extra = G_InitialActorStrength(atwith);
sprite[k].yvel = atwith; // this is a hack to allow you to detect which weapon spawned a SHOTSPARK1 sprite[k].yvel = atwith; // this is a hack to allow you to detect which weapon spawned a SHOTSPARK1
A_SetHitData(k, &hit); A_SetHitData(k, &hit);
@ -3756,9 +3756,9 @@ void P_FragPlayer(int32_t snum)
void P_ProcessWeapon(int32_t snum) void P_ProcessWeapon(int32_t snum)
{ {
DukePlayer_t *p = g_player[snum].ps; DukePlayer_t *const p = g_player[snum].ps;
uint8_t *kb = &p->kickback_pic; uint8_t *const kb = &p->kickback_pic;
int32_t shrunk = (sprite[p->i].yrepeat < 32); const int32_t shrunk = (sprite[p->i].yrepeat < 32);
uint32_t sb_snum = g_player[snum].sync->bits; uint32_t sb_snum = g_player[snum].sync->bits;
int32_t i, j, k; int32_t i, j, k;
@ -4390,7 +4390,7 @@ void P_ProcessInput(int32_t snum)
int32_t j, i, k, doubvel = TICSPERFRAME, shrunk; int32_t j, i, k, doubvel = TICSPERFRAME, shrunk;
int32_t fz, cz, hz, lz, truefdist, x, y, psectlotag; int32_t fz, cz, hz, lz, truefdist, x, y, psectlotag;
uint8_t *kb = &p->kickback_pic; const uint8_t *const kb = &p->kickback_pic;
int16_t tempsect; int16_t tempsect;
if (g_player[snum].playerquitflag == 0) if (g_player[snum].playerquitflag == 0)

View file

@ -2092,7 +2092,7 @@ void A_DamageObject(int32_t i,int32_t sn)
case FUELPOD__STATIC: case FUELPOD__STATIC:
case SOLARPANNEL__STATIC: case SOLARPANNEL__STATIC:
case ANTENNA__STATIC: case ANTENNA__STATIC:
if (sprite[sn].extra != *g_tile[SHOTSPARK1].execPtr) if (sprite[sn].extra != G_InitialActorStrength(SHOTSPARK1))
{ {
for (j=15; j>0; j--) for (j=15; j>0; j--)
A_InsertSprite(SECT,SX,SY,sector[SECT].floorz-(12<<8)-(j<<9),SCRAP1+(krand()&15),-8,64,64, A_InsertSprite(SECT,SX,SY,sector[SECT].floorz-(12<<8)-(j<<9),SCRAP1+(krand()&15),-8,64,64,