X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_player.pas;h=7436e7a95a77d928002f0dd974b74fe045cebda9;hb=2ce8c39f1c6e2ade354a14bd7fce6be00c8c7b0a;hp=897ece3dfc10bb11996e6ebe4df8e0d36fa54819;hpb=397f9cdedf0fb2a1a51d4f585db266b0f4925d97;p=d2df-sdl.git diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 897ece3..7436e7a 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -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,7 +1373,8 @@ begin if gPlayers[i] is TPlayer then begin gPlayers[i].Update(); - if g_Game_IsClient or not g_Game_IsNet then + 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()`! end; @@ -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;