- added a Death.Sky state for missiles that gets used when they hit a sky plane.

- fixed: The Alt HUD did not draw the crosshair in HUD off mode.
This commit is contained in:
Christoph Oelckers 2017-02-25 20:45:28 +01:00
parent 7f78b42f21
commit 35552ce0cb
6 changed files with 52 additions and 32 deletions

View file

@ -810,6 +810,10 @@ void D_Display ()
{
StatusBar->DrawBottomStuff (HUD_AltHud);
if (DrawFSHUD || automapactive) DrawHUD();
if (players[consoleplayer].camera && players[consoleplayer].camera->player)
{
StatusBar->DrawCrosshair();
}
StatusBar->Draw (HUD_AltHud);
StatusBar->DrawTopStuff (HUD_AltHud);
}

View file

@ -1136,10 +1136,6 @@ void DrawHUD()
i=DrawAmmo(CPlayer, hudwidth-5, i);
if (hud_showweapons) DrawWeapons(CPlayer, hudwidth - 5, i);
DrawInventory(CPlayer, 144, hudheight-28);
if (CPlayer->camera && CPlayer->camera->player)
{
StatusBar->DrawCrosshair();
}
if (idmypos) DrawCoordinates(CPlayer);
DrawTime();

View file

@ -654,6 +654,7 @@ xx(Goodbye)
xx(Require)
xx(Exclude)
xx(Userstring)
xx(Sky)
// Special menus
xx(Mainmenu)

View file

@ -111,7 +111,7 @@ void P_BloodSplatter (const DVector3 &pos, AActor *originator, DAngle hitangle);
void P_BloodSplatter2 (const DVector3 &pos, AActor *originator, DAngle hitangle);
void P_RipperBlood (AActor *mo, AActor *bleeder);
int P_GetThingFloorType (AActor *thing);
void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target);
void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target, bool onsky = false);
AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassActor *type);
AActor *P_SpawnMissile (AActor* source, AActor* dest, PClassActor *type, AActor* owner = NULL);

View file

@ -1804,7 +1804,7 @@ bool AActor::Massacre ()
//
//----------------------------------------------------------------------------
void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target, bool onsky)
{
if (mo->flags3 & MF3_EXPLOCOUNT)
{
@ -1832,12 +1832,16 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
}
if (nextstate == NULL) nextstate = mo->FindState(NAME_Death);
if (line != NULL && line->special == Line_Horizon && !(mo->flags3 & MF3_SKYEXPLODE))
if (onsky || (line != NULL && line->special == Line_Horizon))
{
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
// [RH] Don't explode missiles on horizon lines.
mo->Destroy();
return;
}
nextstate = mo->FindState(NAME_Death, NAME_Sky);
}
if (line != NULL && cl_missiledecals)
{
@ -2557,26 +2561,32 @@ double P_XYMovement (AActor *mo, DVector2 scroll)
}
explode:
// explode a missile
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
bool onsky = false;
if (tm.ceilingline &&
tm.ceilingline->backsector &&
tm.ceilingline->backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
mo->Z() >= tm.ceilingline->backsector->ceilingplane.ZatPoint(mo->PosRelative(tm.ceilingline)))
{
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
// Hack to prevent missiles exploding against the sky.
// Does not handle sky floors.
mo->Destroy();
return Oldfloorz;
}
else onsky = true;
}
// [RH] Don't explode on horizon lines.
if (mo->BlockingLine != NULL && mo->BlockingLine->special == Line_Horizon)
{
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
mo->Destroy();
return Oldfloorz;
}
else onsky = true;
}
P_ExplodeMissile (mo, mo->BlockingLine, BlockingMobj);
P_ExplodeMissile (mo, mo->BlockingLine, BlockingMobj, onsky);
return Oldfloorz;
}
else
@ -2955,15 +2965,20 @@ void P_ZMovement (AActor *mo, double oldfloorz)
}
else
{
if (mo->floorpic == skyflatnum && !(mo->flags3 & MF3_SKYEXPLODE))
bool onsky = false;
if (mo->floorpic == skyflatnum)
{
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
// [RH] Just remove the missile without exploding it
// if this is a sky floor.
mo->Destroy();
return;
}
else onsky = true;
}
P_HitFloor (mo);
P_ExplodeMissile (mo, NULL, NULL);
P_ExplodeMissile (mo, NULL, NULL, onsky);
return;
}
}
@ -3056,12 +3071,17 @@ void P_ZMovement (AActor *mo, double oldfloorz)
{
return;
}
if (mo->ceilingpic == skyflatnum && !(mo->flags3 & MF3_SKYEXPLODE))
bool onsky = false;
if (mo->ceilingpic == skyflatnum)
{
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
mo->Destroy();
return;
}
P_ExplodeMissile (mo, NULL, NULL);
else onsky = true;
}
P_ExplodeMissile (mo, NULL, NULL, onsky);
return;
}
}

View file

@ -230,7 +230,6 @@ class Actor : Thinker native
native deprecated double ScaleX;
native deprecated double ScaleY;
//int ConversationRoot; // THe root of the current dialogue;
//FStrifeDialogueNode *Conversation; // [RH] The dialogue to show when this actor is used.;
@ -368,7 +367,7 @@ class Actor : Thinker native
native Vector3 PosRelative(sector sec);
native void HandleSpawnFlags();
native void ExplodeMissile(line lin = null, Actor target = null);
native void ExplodeMissile(line lin = null, Actor target = null, bool onsky = false);
native void RestoreDamage();
native int SpawnHealth();
native void SetDamage(int dmg);