DEADSOFTWARE

Revert "network: server is weapon authority!"
[d2df-sdl.git] / src / game / g_player.pas
index 66f0099063c3027084c4b32418d174acf77ed4e3..c9a640682a1d0cfea8ad3c6cfb6dcdd45a91155f 100644 (file)
@@ -280,7 +280,7 @@ type
     procedure   ReleaseKeysNoWeapon();
     procedure   SetModel(ModelName: String);
     procedure   SetColor(Color: TRGB);
-    procedure   SetWeaponHost(W: Byte);
+    procedure   SetWeapon(W: Byte);
     function    IsKeyPressed(K: Byte): Boolean;
     function    GetKeys(): Byte;
     function    PickItem(ItemType: Byte; arespawn: Boolean; var remove: Boolean): Boolean; virtual;
@@ -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;
@@ -2339,6 +2341,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;
@@ -3887,12 +3908,9 @@ begin
   FNextWeap := $4000;
 end;
 
-// used exclusively by network layer
-procedure TPlayer.SetWeaponHost(W: Byte);
+// used by network layer
+procedure TPlayer.SetWeapon(W: Byte);
 begin
-  if (W > High(FWeapon)) then exit;
-  if (not FWeapon[W]) then exit; // server is authority!
-
   if FCurrWeap <> W then
     if (W = WEAPON_SAW) then
       FSawSoundSelect.PlayAt(FObj.X, FObj.Y);