Fix "shooting" tripbombs from non-players such as the SE shooter.

Well, this never worked anyway, but invoking demons flying out of your
nose is never a good idea.

git-svn-id: https://svn.eduke32.com/eduke32@2977 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-08-28 21:42:49 +00:00
parent 3c5aeae341
commit 26c540e736
2 changed files with 16 additions and 10 deletions

View file

@ -6807,6 +6807,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
break; break;
} }
// If we still see the opening, we can't yet teleport.
if (t[0]==-1) if (t[0]==-1)
{ {
if (sc->floorz > t[3]) if (sc->floorz > t[3])

View file

@ -321,8 +321,8 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
hitdata_t hit; hitdata_t hit;
vec3_t srcvect; vec3_t srcvect;
char sizx,sizy; char sizx,sizy;
spritetype *s = &sprite[i]; spritetype *const s = &sprite[i];
int16_t sect = s->sectnum; const int16_t sect = s->sectnum;
const int32_t p = (s->picnum == APLAYER) ? s->yvel : -1; const int32_t p = (s->picnum == APLAYER) ? s->yvel : -1;
DukePlayer_t *const ps = p >= 0 ? g_player[p].ps : NULL; DukePlayer_t *const ps = p >= 0 ? g_player[p].ps : NULL;
@ -1721,19 +1721,20 @@ SKIPBULLETHOLE:
return j; return j;
case HANDHOLDINGLASER__STATIC: case HANDHOLDINGLASER__STATIC:
{
const int32_t zoff = (p>=0) ? g_player[p].ps->pyoff : 0;
if (p >= 0) if (p >= 0)
zvel = (100-ps->horiz-ps->horizoff)*32; zvel = (100-ps->horiz-ps->horizoff)*32;
else zvel = 0; else zvel = 0;
if (actor[i].shootzvel) zvel = actor[i].shootzvel; if (actor[i].shootzvel) zvel = actor[i].shootzvel;
srcvect.z -= g_player[p].ps->pyoff; srcvect.z -= zoff;
hitscan((const vec3_t *)&srcvect,sect, hitscan((const vec3_t *)&srcvect,sect,
sintable[(sa+512)&2047], sintable[(sa+512)&2047],
sintable[sa&2047], sintable[sa&2047],
zvel<<6,&hit,CLIPMASK1); zvel<<6,&hit,CLIPMASK1);
srcvect.z += zoff;
srcvect.z += g_player[p].ps->pyoff;
j = 0; j = 0;
if (hit.sprite >= 0) break; if (hit.sprite >= 0) break;
@ -1751,7 +1752,8 @@ SKIPBULLETHOLE:
if (j == 1) if (j == 1)
{ {
int32_t lTripBombControl=Gv_GetVarByLabel("TRIPBOMB_CONTROL", TRIPBOMB_TRIPWIRE, g_player[p].ps->i, p); int32_t lTripBombControl = (p < 0) ? 0 :
Gv_GetVarByLabel("TRIPBOMB_CONTROL", TRIPBOMB_TRIPWIRE, g_player[p].ps->i, p);
k = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,TRIPBOMB,-16,4,5,sa,0,0,i,6); k = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,TRIPBOMB,-16,4,5,sa,0,0,i,6);
if (lTripBombControl & TRIPBOMB_TIMER) if (lTripBombControl & TRIPBOMB_TIMER)
{ {
@ -1764,18 +1766,21 @@ SKIPBULLETHOLE:
actor[k].t_data[6]=1; actor[k].t_data[6]=1;
} }
else else
sprite[k].hitag = k; sprite[k].hitag = k;
A_PlaySound(LASERTRIP_ONWALL,k); A_PlaySound(LASERTRIP_ONWALL,k);
sprite[k].xvel = -20; sprite[k].xvel = -20;
A_SetSprite(k,CLIPMASK0); A_SetSprite(k,CLIPMASK0);
sprite[k].cstat = 16; sprite[k].cstat = 16;
actor[k].t_data[5] = sprite[k].ang = getangle(wall[hit.wall].x-wall[wall[hit.wall].point2].x,wall[hit.wall].y-wall[wall[hit.wall].point2].y)-512;
{
int32_t p2 = wall[hit.wall].point2;
int32_t a = getangle(wall[hit.wall].x-wall[p2].x, wall[hit.wall].y-wall[p2].y)-512;
actor[k].t_data[5] = sprite[k].ang = a;
}
} }
return j?k:-1; return j?k:-1;
}
case BOUNCEMINE__STATIC: case BOUNCEMINE__STATIC:
case MORTER__STATIC: case MORTER__STATIC: