This commit is contained in:
Christoph Oelckers 2013-07-28 10:19:08 +02:00
commit b534cba113
4 changed files with 28 additions and 16 deletions

View file

@ -2338,7 +2338,6 @@ void AM_drawKeys ()
//
//
//=============================================================================
void AM_drawThings ()
{
AMColor color;
@ -2355,30 +2354,41 @@ void AM_drawThings ()
p.x = t->x >> FRACTOMAPBITS;
p.y = t->y >> FRACTOMAPBITS;
if (am_showthingsprites > 0)
if (am_showthingsprites > 0 && t->sprite > 0)
{
const spritedef_t& sprite = sprites[t->sprite];
const size_t spriteIndex = sprite.spriteframes + (am_showthingsprites > 1 ? t->frame : 0);
FTexture *texture = NULL;
spriteframe_t *frame;
angle_t rotation = 0;
const spriteframe_t& frame = SpriteFrames[spriteIndex];
angle_t angle = ANGLE_270 - t->angle;
if (frame.Texture[0] != frame.Texture[1]) angle += (ANGLE_180 / 16);
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
// try all modes backwards until a valid texture has been found.
for(int show = am_showthingsprites; show > 0 && texture == NULL; show--)
{
angle += players[consoleplayer].camera->angle - ANGLE_90;
}
const angle_t rotation = angle >> 28;
const spritedef_t& sprite = sprites[t->sprite];
const size_t spriteIndex = sprite.spriteframes + (show > 1 ? t->frame : 0);
const FTextureID textureID = frame.Texture[am_showthingsprites > 2 ? rotation : 0];
FTexture* texture = TexMan(textureID);
frame = &SpriteFrames[spriteIndex];
angle_t angle = ANGLE_270 - t->angle;
if (frame->Texture[0] != frame->Texture[1]) angle += (ANGLE_180 / 16);
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
{
angle += players[consoleplayer].camera->angle - ANGLE_90;
}
rotation = angle >> 28;
const FTextureID textureID = frame->Texture[show > 2 ? rotation : 0];
texture = TexMan(textureID);
}
if (texture == NULL) goto drawTriangle; // fall back to standard display if no sprite can be found.
const fixed_t spriteScale = 10 * scale_mtof;
DrawMarker (texture, p.x, p.y, 0, !!(frame.Flip & (1 << rotation)),
DrawMarker (texture, p.x, p.y, 0, !!(frame->Flip & (1 << rotation)),
spriteScale, spriteScale, 0, FRACUNIT, 0, LegacyRenderStyles[STYLE_Normal]);
}
else
{
drawTriangle:
angle = t->angle;
if (am_rotate == 1 || (am_rotate == 2 && viewactive))

View file

@ -589,7 +589,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
damage += (pr_bfgspray() & 7) + 1;
thingToHit = linetarget;
int newdam = P_DamageMobj (thingToHit, self->target, self->target, damage, spray != NULL? FName(spray->DamageType) : FName(NAME_BFGSplash));
int newdam = P_DamageMobj (thingToHit, self->target, self->target, damage, spray != NULL? FName(spray->DamageType) : FName(NAME_BFGSplash),
spray != NULL && (spray->flags3 & MF3_FOILINVUL)? DMG_FOILINVUL : 0);
P_TraceBleed (newdam > 0 ? newdam : damage, thingToHit, self->target);
}
}

View file

@ -965,7 +965,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
{ // actor is invulnerable
if (target->player == NULL)
{
if (inflictor == NULL || !(inflictor->flags3 & MF3_FOILINVUL))
if (inflictor == NULL || (!(inflictor->flags3 & MF3_FOILINVUL) && !(flags & DMG_FOILINVUL)))
{
return -1;
}

View file

@ -554,6 +554,7 @@ enum EDmgFlags
DMG_FORCED = 8,
DMG_NO_FACTOR = 16,
DMG_PLAYERATTACK = 32,
DMG_FOILINVUL = 64,
};