DEADSOFTWARE

Revert "properly reset weapon states, so player will be able to switch weapons after...
[d2df-sdl.git] / src / game / g_player.pas
index 4429fd0957c2efda42813ebbf0a3801217cea65f..7436e7a95a77d928002f0dd974b74fe045cebda9 100644 (file)
@@ -317,6 +317,7 @@ type
     procedure   DrawPickup();
     procedure   DrawRulez();
     procedure   DrawAim();
+    procedure   DrawIndicator();
     procedure   DrawBubble();
     procedure   DrawGUI();
     procedure   Update(); virtual;
@@ -557,6 +558,7 @@ var
   gFly: Boolean = False;
   gAimLine: Boolean = False;
   gChatBubble: Byte = 0;
+  gPlayerIndicator: Boolean = True;
   gNumBots: Word = 0;
   gLMSPID1: Word = 0;
   gLMSPID2: Word = 0;
@@ -1371,6 +1373,7 @@ begin
       if gPlayers[i] is TPlayer then
       begin
         gPlayers[i].Update();
+        if (not gPlayers[i].alive) then gPlayers[i].NetForceWeapFIdx := 0; // just in case
         //if g_Game_IsClient or not g_Game_IsNet then
         begin
           gPlayers[i].RealizeCurrentWeapon(); // WARNING! DO NOT MOVE THIS INTO `Update()`!
@@ -2340,6 +2343,25 @@ begin
   inherited;
 end;
 
+procedure TPlayer.DrawIndicator();
+var
+  indX, indY: Integer;
+  indW, indH: Word;
+  ID: DWORD;
+begin
+  if FAlive then
+    begin
+      indX := FObj.X+FObj.Rect.X;
+      indY := FObj.Y - 12;
+      if g_Texture_Get('TEXTURE_PLAYER_INDICATOR', ID) then
+        begin
+          e_GetTextureSize(ID, @indW, @indH);
+          e_Draw(ID, indX + indW div 2, indY, 0, True, False);
+        end;
+    end;
+  //e_TextureFontPrint(indX, indY, FName, gStdFont); // Shows player name overhead
+end;
+
 procedure TPlayer.DrawBubble();
 var
   bubX, bubY: Integer;
@@ -4362,7 +4384,7 @@ begin
   FSecrets := 0;
   //FCurrFrameIdx := 0;
   //FNetForceWeap := FCurrWeap;
-  //FNetForceWeapFIdx := 0;
+  FNetForceWeapFIdx := 0;
   if FNoRespawn then
   begin
     FSpectator := False;
@@ -4388,6 +4410,7 @@ begin
   FLastHit := 0;
   FLastFrag := 0;
   FComboEvnt := -1;
+  FNetForceWeapFIdx := 0;
 
   SetFlag(FLAG_NONE);
   SetAction(A_STAND, True);
@@ -4555,6 +4578,7 @@ begin
   FPain := 0;
   FLastHit := 0;
   //FNetForceWeap := FCurrWeap;
+  FNetForceWeapFIdx := 0;
 
   if not g_Game_IsServer then
     Exit;