- 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); StatusBar->DrawBottomStuff (HUD_AltHud);
if (DrawFSHUD || automapactive) DrawHUD(); if (DrawFSHUD || automapactive) DrawHUD();
if (players[consoleplayer].camera && players[consoleplayer].camera->player)
{
StatusBar->DrawCrosshair();
}
StatusBar->Draw (HUD_AltHud); StatusBar->Draw (HUD_AltHud);
StatusBar->DrawTopStuff (HUD_AltHud); StatusBar->DrawTopStuff (HUD_AltHud);
} }

View File

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

View File

@ -654,6 +654,7 @@ xx(Goodbye)
xx(Require) xx(Require)
xx(Exclude) xx(Exclude)
xx(Userstring) xx(Userstring)
xx(Sky)
// Special menus // Special menus
xx(Mainmenu) 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_BloodSplatter2 (const DVector3 &pos, AActor *originator, DAngle hitangle);
void P_RipperBlood (AActor *mo, AActor *bleeder); void P_RipperBlood (AActor *mo, AActor *bleeder);
int P_GetThingFloorType (AActor *thing); 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_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassActor *type);
AActor *P_SpawnMissile (AActor* source, AActor* dest, PClassActor *type, AActor* owner = NULL); 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) if (mo->flags3 & MF3_EXPLOCOUNT)
{ {
@ -1832,11 +1832,15 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
} }
if (nextstate == NULL) nextstate = mo->FindState(NAME_Death); 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))
{ {
// [RH] Don't explode missiles on horizon lines. if (!(mo->flags3 & MF3_SKYEXPLODE))
mo->Destroy (); {
return; // [RH] Don't explode missiles on horizon lines.
mo->Destroy();
return;
}
nextstate = mo->FindState(NAME_Death, NAME_Sky);
} }
if (line != NULL && cl_missiledecals) if (line != NULL && cl_missiledecals)
@ -2557,26 +2561,32 @@ double P_XYMovement (AActor *mo, DVector2 scroll)
} }
explode: explode:
// explode a missile // explode a missile
if (!(mo->flags3 & MF3_SKYEXPLODE)) bool onsky = false;
{
if (tm.ceilingline && if (tm.ceilingline &&
tm.ceilingline->backsector && tm.ceilingline->backsector &&
tm.ceilingline->backsector->GetTexture(sector_t::ceiling) == skyflatnum && tm.ceilingline->backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
mo->Z() >= tm.ceilingline->backsector->ceilingplane.ZatPoint(mo->PosRelative(tm.ceilingline))) mo->Z() >= tm.ceilingline->backsector->ceilingplane.ZatPoint(mo->PosRelative(tm.ceilingline)))
{ {
// Hack to prevent missiles exploding against the sky. if (!(mo->flags3 & MF3_SKYEXPLODE))
// Does not handle sky floors. {
mo->Destroy (); // Hack to prevent missiles exploding against the sky.
return Oldfloorz; // Does not handle sky floors.
mo->Destroy();
return Oldfloorz;
}
else onsky = true;
} }
// [RH] Don't explode on horizon lines. // [RH] Don't explode on horizon lines.
if (mo->BlockingLine != NULL && mo->BlockingLine->special == Line_Horizon) if (mo->BlockingLine != NULL && mo->BlockingLine->special == Line_Horizon)
{ {
mo->Destroy (); if (!(mo->flags3 & MF3_SKYEXPLODE))
return Oldfloorz; {
mo->Destroy();
return Oldfloorz;
}
else onsky = true;
} }
} P_ExplodeMissile (mo, mo->BlockingLine, BlockingMobj, onsky);
P_ExplodeMissile (mo, mo->BlockingLine, BlockingMobj);
return Oldfloorz; return Oldfloorz;
} }
else else
@ -2955,15 +2965,20 @@ void P_ZMovement (AActor *mo, double oldfloorz)
} }
else else
{ {
if (mo->floorpic == skyflatnum && !(mo->flags3 & MF3_SKYEXPLODE)) bool onsky = false;
if (mo->floorpic == skyflatnum)
{ {
// [RH] Just remove the missile without exploding it if (!(mo->flags3 & MF3_SKYEXPLODE))
// if this is a sky floor. {
mo->Destroy (); // [RH] Just remove the missile without exploding it
return; // if this is a sky floor.
mo->Destroy();
return;
}
else onsky = true;
} }
P_HitFloor (mo); P_HitFloor (mo);
P_ExplodeMissile (mo, NULL, NULL); P_ExplodeMissile (mo, NULL, NULL, onsky);
return; return;
} }
} }
@ -3056,12 +3071,17 @@ void P_ZMovement (AActor *mo, double oldfloorz)
{ {
return; return;
} }
if (mo->ceilingpic == skyflatnum && !(mo->flags3 & MF3_SKYEXPLODE)) bool onsky = false;
if (mo->ceilingpic == skyflatnum)
{ {
mo->Destroy (); if (!(mo->flags3 & MF3_SKYEXPLODE))
return; {
mo->Destroy();
return;
}
else onsky = true;
} }
P_ExplodeMissile (mo, NULL, NULL); P_ExplodeMissile (mo, NULL, NULL, onsky);
return; return;
} }
} }

View File

@ -230,7 +230,6 @@ class Actor : Thinker native
native deprecated double ScaleX; native deprecated double ScaleX;
native deprecated double ScaleY; native deprecated double ScaleY;
//int ConversationRoot; // THe root of the current dialogue;
//FStrifeDialogueNode *Conversation; // [RH] The dialogue to show when this actor is used.; //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 Vector3 PosRelative(sector sec);
native void HandleSpawnFlags(); 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 void RestoreDamage();
native int SpawnHealth(); native int SpawnHealth();
native void SetDamage(int dmg); native void SetDamage(int dmg);