diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 66f0099063c3027084c4b32418d174acf77ed4e3..5968cd1f4058e606d44ce0a45f9b2cc882cd4cc0 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
procedure ReleaseKeysNoWeapon();
procedure SetModel(ModelName: String);
procedure SetColor(Color: TRGB);
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;
function IsKeyPressed(K: Byte): Boolean;
function GetKeys(): Byte;
function PickItem(ItemType: Byte; arespawn: Boolean; var remove: Boolean): Boolean; virtual;
procedure DrawPickup();
procedure DrawRulez();
procedure DrawAim();
procedure DrawPickup();
procedure DrawRulez();
procedure DrawAim();
+ procedure DrawIndicator();
procedure DrawBubble();
procedure DrawGUI();
procedure Update(); virtual;
procedure DrawBubble();
procedure DrawGUI();
procedure Update(); virtual;
gFly: Boolean = False;
gAimLine: Boolean = False;
gChatBubble: Byte = 0;
gFly: Boolean = False;
gAimLine: Boolean = False;
gChatBubble: Byte = 0;
+ gPlayerIndicator: Boolean = True;
gNumBots: Word = 0;
gLMSPID1: Word = 0;
gLMSPID2: Word = 0;
gNumBots: Word = 0;
gLMSPID1: Word = 0;
gLMSPID2: Word = 0;
begin
if gPlayers[i] is TPlayer then
begin
begin
if gPlayers[i] is TPlayer then
begin
- //if (gPlayers[i].NetForceWeapFIdx > gTime) then writeln('*** PLAYER #', i, '; gTime=', gTime, '; nfwf=', gPlayers[i].NetForceWeapFIdx);
gPlayers[i].Update();
gPlayers[i].Update();
- if (not gPlayers[i].alive) or (gPlayers[i].NetForceWeapFIdx >= gTime+15) then gPlayers[i].NetForceWeapFIdx := 0; // just in case
- gPlayers[i].RealizeCurrentWeapon(); // WARNING! DO NOT MOVE THIS INTO `Update()`!
+ //if g_Game_IsClient or not g_Game_IsNet then
+ begin
+ gPlayers[i].RealizeCurrentWeapon(); // WARNING! DO NOT MOVE THIS INTO `Update()`!
+ end;
end
else
begin
end
else
begin
inherited;
end;
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;
procedure TPlayer.DrawBubble();
var
bubX, bubY: Integer;
WEAPON_FLAMETHROWER = 10;
*)
WEAPON_FLAMETHROWER = 10;
*)
- {
- if (FNextWeap <> 0) or (FNextWeapDelay <> 0) then
- begin
- e_WriteLog(Format('!!! FNextWeap=%04x; FNextWeapDelay=%d', [FNextWeap, FNextWeapDelay]), TMsgType.Warning);
- end;
- }
-
// cycling has priority
if (FNextWeap and $C000) <> 0 then
begin
// cycling has priority
if (FNextWeap and $C000) <> 0 then
begin
if not switchAllowed then
begin
if not switchAllowed then
begin
- //writeln('WEAPON SWITCHING IS NOT ALLOWED! FBFGFireCounter=', FBFGFireCounter, '; gTime=', gTime, '; FTime[T_SWITCH]=', FTime[T_SWITCH]);
//HACK for weapon cycling
if (FNextWeap and $E000) <> 0 then FNextWeap := 0;
exit;
end;
//HACK for weapon cycling
if (FNextWeap and $E000) <> 0 then FNextWeap := 0;
exit;
end;
- if (FNetForceWeapFIdx >= gTime+15) then FNetForceWeapFIdx := 0;
-
nw := getNextWeaponIndex();
if nw = 255 then exit; // don't reset anything here
if nw > High(FWeapon) then
nw := getNextWeaponIndex();
if nw = 255 then exit; // don't reset anything here
if nw > High(FWeapon) then
FNextWeap := $4000;
end;
FNextWeap := $4000;
end;
-// used exclusively by network layer
-procedure TPlayer.SetWeaponHost(W: Byte);
+// used by network layer
+procedure TPlayer.SetWeapon(W: Byte);
begin
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);
if FCurrWeap <> W then
if (W = WEAPON_SAW) then
FSawSoundSelect.PlayAt(FObj.X, FObj.Y);
end;
procedure TPlayer.Reset(Force: Boolean);
end;
procedure TPlayer.Reset(Force: Boolean);
-var
- i: Integer;
begin
if Force then
FAlive := False;
begin
if Force then
FAlive := False;
FSecrets := 0;
//FCurrFrameIdx := 0;
//FNetForceWeap := FCurrWeap;
FSecrets := 0;
//FCurrFrameIdx := 0;
//FNetForceWeap := FCurrWeap;
- FNetForceWeapFIdx := 0;
- resetWeaponQueue();
+ //FNetForceWeapFIdx := 0;
if FNoRespawn then
begin
FSpectator := False;
if FNoRespawn then
begin
FSpectator := False;
end;
FLives := gGameSettings.MaxLives;
end;
FLives := gGameSettings.MaxLives;
- FBFGFireCounter := -1;
- FTime[T_SWITCH] := 0;
- for i := WP_FIRST to WP_LAST do FReloading[i] := 0;
-
SetFlag(FLAG_NONE);
end;
procedure TPlayer.SoftReset();
SetFlag(FLAG_NONE);
end;
procedure TPlayer.SoftReset();
-var
- i: Integer;
begin
ReleaseKeys();
begin
ReleaseKeys();
FLastHit := 0;
FLastFrag := 0;
FComboEvnt := -1;
FLastHit := 0;
FLastFrag := 0;
FComboEvnt := -1;
- FNetForceWeapFIdx := 0;
- resetWeaponQueue();
-
- FBFGFireCounter := -1;
- FTime[T_SWITCH] := 0;
- for i := WP_FIRST to WP_LAST do FReloading[i] := 0;
SetFlag(FLAG_NONE);
SetAction(A_STAND, True);
SetFlag(FLAG_NONE);
SetAction(A_STAND, True);
a, b, c: Byte;
Anim: TAnimation;
ID: DWORD;
a, b, c: Byte;
Anim: TAnimation;
ID: DWORD;
- i: Integer;
begin
FIncCam := 0;
FBFGFireCounter := -1;
begin
FIncCam := 0;
FBFGFireCounter := -1;
FPain := 0;
FLastHit := 0;
//FNetForceWeap := FCurrWeap;
FPain := 0;
FLastHit := 0;
//FNetForceWeap := FCurrWeap;
- FNetForceWeapFIdx := 0;
- resetWeaponQueue();
-
- FBFGFireCounter := -1;
- FTime[T_SWITCH] := 0;
- for i := WP_FIRST to WP_LAST do FReloading[i] := 0;
if not g_Game_IsServer then
Exit;
if not g_Game_IsServer then
Exit;
FWeapon[WEAPON_KASTET] := True;
FCurrWeap := WEAPON_PISTOL;
//FNetForceWeap := FCurrWeap;
FWeapon[WEAPON_KASTET] := True;
FCurrWeap := WEAPON_PISTOL;
//FNetForceWeap := FCurrWeap;
- FNetForceWeapFIdx := 0;
resetWeaponQueue();
FModel.SetWeapon(FCurrWeap);
resetWeaponQueue();
FModel.SetWeapon(FCurrWeap);
begin
FCurrWeap := WEAPON_KASTET;
//FNetForceWeap := FCurrWeap;
begin
FCurrWeap := WEAPON_KASTET;
//FNetForceWeap := FCurrWeap;
- FNetForceWeapFIdx := 0;
resetWeaponQueue();
FModel.SetWeapon(WEAPON_KASTET);
end;
resetWeaponQueue();
FModel.SetWeapon(WEAPON_KASTET);
end;
FAIFlags := nil;
FSelectedWeapon := FCurrWeap;
FAIFlags := nil;
FSelectedWeapon := FCurrWeap;
- FNetForceWeapFIdx := 0;
resetWeaponQueue();
FTargetUID := 0;
end;
resetWeaponQueue();
FTargetUID := 0;
end;