Add SFLAG_REALCLIPDIST to bypass hard-coded clipdist fuckery based on xrepeat and picnum. This also changes some bad uses of A_CheckSpriteTileFlags() into A_CheckSpriteFlags() instead.

git-svn-id: https://svn.eduke32.com/eduke32@5602 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2016-02-02 00:21:17 +00:00
parent 7466904eaf
commit 8ac3e86da3
6 changed files with 17 additions and 11 deletions

View file

@ -423,13 +423,15 @@ int32_t A_MoveSpriteClipdist(int32_t spritenum, const vec3_t *change, uint32_t c
{
// use that value
}
else if (A_CheckSpriteFlags(spritenum, SFLAG_REALCLIPDIST))
clipdist = spr->clipdist<<2;
else if (badguy)
{
if (spr->xrepeat > 60)
clipdist = 1024;
else if (spr->picnum == LIZMAN)
clipdist = 292;
else if (A_CheckSpriteTileFlags(spr->picnum, SFLAG_BADGUY))
else if (A_CheckSpriteFlags(spritenum, SFLAG_BADGUY))
clipdist = spr->clipdist<<2;
else
clipdist = 192;
@ -733,7 +735,7 @@ static int32_t move_rotfixed_sprite(int32_t j, int32_t pivotspr, int32_t daang)
{
if ((ROTFIXSPR_STATNUMP(sprite[j].statnum) ||
((sprite[j].statnum == STAT_ACTOR || sprite[j].statnum == STAT_ZOMBIEACTOR) &&
A_CheckSpriteTileFlags(sprite[j].picnum, SFLAG_ROTFIXED))) &&
A_CheckSpriteFlags(j, SFLAG_ROTFIXED))) &&
actor[j].t_data[7] == (ROTFIXSPR_MAGIC | pivotspr))
{
rotatepoint(zerovec, *(vec2_t *)&actor[j].t_data[8], daang & 2047, (vec2_t *)&sprite[j].x);
@ -1035,8 +1037,8 @@ int32_t A_IncurDamage(int32_t sn)
break;
default:
if (A_CheckSpriteTileFlags(dmg->picnum, SFLAG_PROJECTILE) &&
(SpriteProjectile[sn].workslike & PROJECTILE_RPG))
if (A_CheckSpriteFlags(dmg->owner, SFLAG_PROJECTILE) &&
(SpriteProjectile[dmg->owner].workslike & PROJECTILE_RPG))
P_Nudge(p, sn, 2);
else
P_Nudge(p, sn, 1);
@ -4396,7 +4398,7 @@ ACTOR_STATIC void G_MoveActors(void)
{
for (SPRITES_OF_SECT(sect, j))
{
if (A_CheckSpriteTileFlags(sprite[j].picnum, SFLAG_GREENSLIMEFOOD))
if (A_CheckSpriteFlags(j, SFLAG_GREENSLIMEFOOD))
{
if (ldist(s,&sprite[j]) < 768 && (klabs(s->z-sprite[j].z)<8192)) //Gulp them
{

View file

@ -258,6 +258,7 @@ enum sflags_t {
SFLAG_NOWATERDIP = 0x00200000,
SFLAG_HURTSPAWNBLOOD = 0x00400000,
SFLAG_GREENSLIMEFOOD = 0x00800000,
SFLAG_REALCLIPDIST = 0x01000000
};
// Custom projectiles "workslike" flags.

View file

@ -5275,7 +5275,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
if (sp->xrepeat == 0 || sp->yrepeat == 0)
sp->xrepeat = sp->yrepeat = 1;
if (A_CheckSpriteTileFlags(sp->picnum, SFLAG_BADGUY))
if (A_CheckSpriteFlags(i, SFLAG_BADGUY))
{
if (ud.monsters_off == 1)
{
@ -5286,7 +5286,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
A_Fall(i);
if (A_CheckSpriteTileFlags(sp->picnum, SFLAG_BADGUYSTAYPUT))
if (A_CheckSpriteFlags(i, SFLAG_BADGUYSTAYPUT))
actor[i].actorstayput = sp->sectnum;
g_player[myconnectindex].ps->max_actors_killed++;

View file

@ -6058,6 +6058,9 @@ static void C_AddDefaultDefinitions(void)
C_AddDefinition("SFLAG_NOTELEPORT", SFLAG_NOTELEPORT, LABEL_DEFINE);
C_AddDefinition("SFLAG_NODAMAGEPUSH", SFLAG_NODAMAGEPUSH, LABEL_DEFINE);
C_AddDefinition("SFLAG_NOWATERDIP", SFLAG_NOWATERDIP, LABEL_DEFINE);
C_AddDefinition("SFLAG_HURTSPAWNBLOOD", SFLAG_HURTSPAWNBLOOD, LABEL_DEFINE);
C_AddDefinition("SFLAG_GREENSLIMEFOOD", SFLAG_GREENSLIMEFOOD, LABEL_DEFINE);
C_AddDefinition("SFLAG_REALCLIPDIST", SFLAG_REALCLIPDIST, LABEL_DEFINE);
C_AddDefinition("STR_MAPNAME",STR_MAPNAME,LABEL_DEFINE);
C_AddDefinition("STR_MAPFILENAME",STR_MAPFILENAME,LABEL_DEFINE);

View file

@ -983,7 +983,7 @@ static void G_SetupRotfixedSprites(void)
// too useful with moving sectors anyway
if ((ROTFIXSPR_STATNUMP(spr->statnum) && spr->picnum!=TRIPBOMB) ||
((spr->statnum==STAT_ACTOR || spr->statnum==STAT_ZOMBIEACTOR) &&
A_CheckSpriteTileFlags(spr->picnum, SFLAG_ROTFIXED)))
A_CheckSpriteFlags(j, SFLAG_ROTFIXED)))
{
int32_t pivot = i;

View file

@ -1527,7 +1527,7 @@ void A_DamageWall(int32_t spr, int32_t dawallnum, const vec3_t *pos, int32_t atw
walltype *wal = &wall[dawallnum];
if (wal->overpicnum == MIRROR && wal->pal != 4 &&
A_CheckSpriteTileFlags(atwith,SFLAG_PROJECTILE) &&
A_CheckSpriteFlags(spr,SFLAG_PROJECTILE) &&
(SpriteProjectile[spr].workslike & PROJECTILE_RPG))
{
if (wal->nextwall == -1 || wall[wal->nextwall].pal != 4)
@ -2273,7 +2273,7 @@ void A_DamageObject(int32_t i,int32_t sn)
if ((PN != DRONE) && (PN != ROTATEGUN) && (PN != COMMANDER) && (PN < GREENSLIME || PN > GREENSLIME+7))
if (sprite[sn].picnum != FREEZEBLAST)
if (!A_CheckSpriteTileFlags(PN, SFLAG_BADGUY) || A_CheckSpriteTileFlags(PN, SFLAG_HURTSPAWNBLOOD))
if (!A_CheckSpriteFlags(i, SFLAG_BADGUY) || A_CheckSpriteFlags(i, SFLAG_HURTSPAWNBLOOD))
{
j = A_Spawn(sn,JIBS6);
if (sprite[sn].pal == 6)
@ -2288,7 +2288,7 @@ void A_DamageObject(int32_t i,int32_t sn)
if (j >= 0 && sprite[j].picnum == APLAYER && PN != ROTATEGUN && PN != DRONE)
if (g_player[P_Get(j)].ps->curr_weapon == SHOTGUN_WEAPON)
if (!A_CheckSpriteTileFlags(PN, SFLAG_BADGUY) || A_CheckSpriteTileFlags(PN, SFLAG_HURTSPAWNBLOOD))
if (!A_CheckSpriteFlags(i, SFLAG_BADGUY) || A_CheckSpriteFlags(i, SFLAG_HURTSPAWNBLOOD))
{
A_Shoot(i,BLOODSPLAT3);
A_Shoot(i,BLOODSPLAT1);