mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 09:21:36 +00:00
In upward moving enemy code of VM_Move(), consider TROR boundaries.
This fixes liztroops not passing TROR layers when on the jetpack, as well as other enemies capable of moving upward, and also COMMANDER and DRONE (for which the code is special-cased). git-svn-id: https://svn.eduke32.com/eduke32@3666 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0dba35b207
commit
a25cd24dd5
3 changed files with 43 additions and 12 deletions
|
@ -13488,7 +13488,7 @@ restart_grand:
|
|||
if (dy > 0) day = dy*(xmax-x1); else day = dy*(xmin-x1);
|
||||
if (dax >= day) continue;
|
||||
|
||||
if (wal->cstat&dawalclipmask) continue;
|
||||
if (wal->cstat&dawalclipmask) continue; // XXX?
|
||||
sec = §or[k];
|
||||
|
||||
#ifdef HAVE_CLIPSHAPE_FEATURE
|
||||
|
|
|
@ -6901,7 +6901,7 @@ PALONLY:
|
|||
#ifndef LUNATIC
|
||||
skip:
|
||||
#endif
|
||||
// XXX: currently, for the splitscreen mod, sprites will be pal6-colored iff the first
|
||||
// XXX: Currently, for the splitscreen mod, sprites will be pal6-colored iff the first
|
||||
// player has nightvision on. We should pass stuff like "from which player is this view
|
||||
// supposed to be" as parameters ("drawing context") instead of relying on globals.
|
||||
if (g_player[screenpeek].ps->inv_amount[GET_HEATS] > 0 && g_player[screenpeek].ps->heat_on &&
|
||||
|
@ -6916,10 +6916,12 @@ skip:
|
|||
{
|
||||
if (actor[i].dispicnum < 0)
|
||||
{
|
||||
// a negative actor[i].dispicnum used to mean 'no floor shadow please' but
|
||||
// that was a bad hack since the value could propagate to sprite[].picnum
|
||||
#ifdef DEBUGGINGAIDS
|
||||
// A negative actor[i].dispicnum used to mean 'no floor shadow please', but
|
||||
// that was a bad hack since the value could propagate to sprite[].picnum.
|
||||
OSD_Printf(OSD_ERROR "actor[%d].dispicnum = %d\n", i, actor[i].dispicnum);
|
||||
actor[i].dispicnum++;
|
||||
#endif
|
||||
actor[i].dispicnum=0;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -6938,7 +6940,6 @@ skip:
|
|||
|
||||
if ((s->z-daz) < (8<<8) && g_player[screenpeek].ps->pos.z < daz)
|
||||
{
|
||||
//int32_t xrep, yrep;
|
||||
spritetype *const newt = &tsprite[spritesortcnt];
|
||||
|
||||
Bmemcpy(newt, t, sizeof(spritetype));
|
||||
|
|
|
@ -355,7 +355,6 @@ void A_GetZLimits(int32_t iActor)
|
|||
|| (hitspr->picnum == APLAYER && A_CheckEnemySprite(s)))
|
||||
{
|
||||
actor[iActor].flags |= SPRITE_NOFLOORSHADOW; // No shadows on actors
|
||||
// actor[iActor].dispicnum = -4; // No shadows on actors
|
||||
s->xvel = -256;
|
||||
A_SetSprite(iActor,CLIPMASK0);
|
||||
}
|
||||
|
@ -554,6 +553,37 @@ static void VM_FacePlayer(int32_t shr)
|
|||
VM_AddAngle(shr, goalang);
|
||||
}
|
||||
|
||||
////////// TROR get*zofslope //////////
|
||||
// These rather belong into the engine.
|
||||
|
||||
static int32_t yax_getceilzofslope(int16_t sectnum, int32_t dax, int32_t day)
|
||||
{
|
||||
#ifdef YAX_ENABLE
|
||||
if ((sector[sectnum].ceilingstat&512)==0)
|
||||
{
|
||||
int32_t nsect = yax_getneighborsect(dax, day, sectnum, YAX_CEILING);
|
||||
if (nsect >= 0)
|
||||
return getceilzofslope(nsect, dax, day);
|
||||
}
|
||||
#endif
|
||||
return getceilzofslope(sectnum, dax, day);
|
||||
}
|
||||
|
||||
static int32_t yax_getflorzofslope(int16_t sectnum, int32_t dax, int32_t day)
|
||||
{
|
||||
#ifdef YAX_ENABLE
|
||||
if ((sector[sectnum].floorstat&512)==0)
|
||||
{
|
||||
int32_t nsect = yax_getneighborsect(dax, day, sectnum, YAX_FLOOR);
|
||||
if (nsect >= 0)
|
||||
return getflorzofslope(nsect, dax, day);
|
||||
}
|
||||
#endif
|
||||
return getflorzofslope(sectnum, dax, day);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
GAMEEXEC_STATIC void VM_Move(void)
|
||||
{
|
||||
#if !defined LUNATIC
|
||||
|
@ -645,14 +675,14 @@ dead:
|
|||
int32_t l;
|
||||
// NOTE: COMMANDER updates both actor[].floorz and
|
||||
// .ceilingz regardless of its zvel.
|
||||
actor[vm.g_i].floorz = l = getflorzofslope(vm.g_sp->sectnum,vm.g_sp->x,vm.g_sp->y);
|
||||
actor[vm.g_i].floorz = l = yax_getflorzofslope(vm.g_sp->sectnum,vm.g_sp->x,vm.g_sp->y);
|
||||
if (vm.g_sp->z > l-(8<<8))
|
||||
{
|
||||
vm.g_sp->z = l-(8<<8);
|
||||
vm.g_sp->zvel = 0;
|
||||
}
|
||||
|
||||
actor[vm.g_i].ceilingz = l = getceilzofslope(vm.g_sp->sectnum,vm.g_sp->x,vm.g_sp->y);
|
||||
actor[vm.g_i].ceilingz = l = yax_getceilzofslope(vm.g_sp->sectnum,vm.g_sp->x,vm.g_sp->y);
|
||||
if (vm.g_sp->z < l+(80<<8))
|
||||
{
|
||||
vm.g_sp->z = l+(80<<8);
|
||||
|
@ -665,13 +695,13 @@ dead:
|
|||
// The DRONE updates either .floorz or .ceilingz, not both.
|
||||
if (vm.g_sp->zvel > 0)
|
||||
{
|
||||
actor[vm.g_i].floorz = l = getflorzofslope(vm.g_sp->sectnum,vm.g_sp->x,vm.g_sp->y);
|
||||
actor[vm.g_i].floorz = l = yax_getflorzofslope(vm.g_sp->sectnum,vm.g_sp->x,vm.g_sp->y);
|
||||
if (vm.g_sp->z > l-(30<<8))
|
||||
vm.g_sp->z = l-(30<<8);
|
||||
}
|
||||
else
|
||||
{
|
||||
actor[vm.g_i].ceilingz = l = getceilzofslope(vm.g_sp->sectnum,vm.g_sp->x,vm.g_sp->y);
|
||||
actor[vm.g_i].ceilingz = l = yax_getceilzofslope(vm.g_sp->sectnum,vm.g_sp->x,vm.g_sp->y);
|
||||
if (vm.g_sp->z < l+(50<<8))
|
||||
{
|
||||
vm.g_sp->z = l+(50<<8);
|
||||
|
@ -688,7 +718,7 @@ dead:
|
|||
vm.g_sp->z = actor[vm.g_i].floorz;
|
||||
if (vm.g_sp->zvel < 0)
|
||||
{
|
||||
const int32_t l = getceilzofslope(vm.g_sp->sectnum,vm.g_sp->x,vm.g_sp->y);
|
||||
const int32_t l = yax_getceilzofslope(vm.g_sp->sectnum,vm.g_sp->x,vm.g_sp->y);
|
||||
|
||||
if (vm.g_sp->z < l+(66<<8))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue