summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: 54f428b)
raw | patch | inline | side by side (from parent 1: 54f428b)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 4 Jan 2019 19:58:37 +0000 (22:58 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 4 Jan 2019 19:58:37 +0000 (22:58 +0300) |
src/game/g_netmsg.pas | patch | blob | history | |
src/game/g_player.pas | patch | blob | history |
diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index f235035fbda6d740146eb383d07d4e66e740948f..9563b8083f9fd7d1f7955a35fb0a36a96200cf35 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
begin
if isKeyPressed(KeyWeapon[I], KeyWeapon2[I]) then
begin
begin
if isKeyPressed(KeyWeapon[I], KeyWeapon2[I]) then
begin
- //writeln('keyweapon #', i, ' is pressed; released=', Integer(gPlayer1.isWeaponSwitchKeyReleased(i)), '; frm=', gPlayer1.NetForceWeapFIdx, '; gTime=', gTime);
gPlayer1.weaponSwitchKeysStateChange(i, true);
if gPlayer1.isWeaponSwitchKeyReleased(i) then
begin
gPlayer1.weaponSwitchKeysStateChange(i, true);
if gPlayer1.isWeaponSwitchKeyReleased(i) then
begin
- //writeln('keyweapon #', i, ' is pressed; released=', Integer(gPlayer1.isWeaponSwitchKeyReleased(i)), '; frm=', gPlayer1.NetForceWeapFIdx, '; gTime=', gTime);
gPlayer1.QueueWeaponSwitch(i); // all choices are passed there, and god will take the best
//WeaponSelect := WeaponSelect or Word(1 shl I);
end;
gPlayer1.QueueWeaponSwitch(i); // all choices are passed there, and god will take the best
//WeaponSelect := WeaponSelect or Word(1 shl I);
end;
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index c9a640682a1d0cfea8ad3c6cfb6dcdd45a91155f..7436e7a95a77d928002f0dd974b74fe045cebda9 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
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 (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;
end
else
begin
end
else
begin
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
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;
//FCurrFrameIdx := 0;
//FNetForceWeap := FCurrWeap;
FNetForceWeapFIdx := 0;
//FCurrFrameIdx := 0;
//FNetForceWeap := FCurrWeap;
FNetForceWeapFIdx := 0;
- resetWeaponQueue();
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();
FLastFrag := 0;
FComboEvnt := -1;
FNetForceWeapFIdx := 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;
FLastHit := 0;
//FNetForceWeap := FCurrWeap;
FNetForceWeapFIdx := 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;