diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 6c7006be15f110d75aa1774838a35812e255337e..d9dd8871a953815a003809dbeacb6d231539f1e7 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
gPlayerIndicator: Integer = 1;
gPlayerIndicatorStyle: Integer = 0;
gNumBots: Word = 0;
gPlayerIndicator: Integer = 1;
gPlayerIndicatorStyle: Integer = 0;
gNumBots: Word = 0;
- gLMSPID1: Word = 0;
- gLMSPID2: Word = 0;
+ gSpectLatchPID1: Word = 0;
+ gSpectLatchPID2: Word = 0;
MAX_RUNVEL: Integer = 8;
VEL_JUMP: Integer = 10;
SHELL_TIMEOUT: Cardinal = 60000;
MAX_RUNVEL: Integer = 8;
VEL_JUMP: Integer = 10;
SHELL_TIMEOUT: Cardinal = 60000;
Break;
end;
Break;
end;
-// Èìåíè íåò, çàäàåì ñëó÷àéíîå:
- if _name = '' then
- repeat
- _name := Format('DFBOT%.2d', [Random(100)]);
- until g_Player_ValidName(_name);
-
// Âûáèðàåì ñëó÷àéíóþ ìîäåëü:
_model := m[Random(Length(m))];
// Âûáèðàåì ñëó÷àéíóþ ìîäåëü:
_model := m[Random(Length(m))];
Min(Random(9)*32, 255)),
Team, True)) as TBot do
begin
Min(Random(9)*32, 255)),
Team, True)) as TBot do
begin
- Name := _name;
+ // Åñëè èìåíè íåò, äåëàåì åãî èç UID áîòà
+ if _name = '' then
+ Name := Format('DFBOT%.5d', [UID])
+ else
+ Name := _name;
case Difficult of
1: FDifficult := DIFFICULT_EASY;
case Difficult of
1: FDifficult := DIFFICULT_EASY;
e_CharFont_PrintEx(gMenuSmallFont, X-16-tw, Y+32, s, _RGB(255, 0, 0));
end;
e_CharFont_PrintEx(gMenuSmallFont, X-16-tw, Y+32, s, _RGB(255, 0, 0));
end;
- if gShowLives and (gGameSettings.MaxLives > 0) then
+ if gLMSRespawn = LMS_RESPAWN_WARMUP then
+ begin
+ s := _lc[I_GAME_WARMUP];
+ e_CharFont_GetSize(gMenuFont, s, tw, th);
+ s := s + ': ' + IntToStr((gLMSRespawnTime - gTime) div 1000);
+ e_CharFont_PrintEx(gMenuFont, X-64-tw, SY-32, s, _RGB(0, 255, 0));
+ end
+ else if gShowLives and (gGameSettings.MaxLives > 0) then
begin
s := IntToStr(Lives);
e_CharFont_GetSize(gMenuFont, s, tw, th);
begin
s := IntToStr(Lives);
e_CharFont_GetSize(gMenuFont, s, tw, th);
// Âûáðîñ êëþ÷åé:
if (not (gGameSettings.GameMode in [GM_DM, GM_TDM, GM_CTF])) or
// Âûáðîñ êëþ÷åé:
if (not (gGameSettings.GameMode in [GM_DM, GM_TDM, GM_CTF])) or
- LongBool(gGameSettings.Options and GAME_OPTION_DMKEYS) then
+ (not LongBool(gGameSettings.Options and GAME_OPTION_DMKEYS)) then
begin
if R_KEY_RED in FRulez then
PushItem(ITEM_KEY_RED);
begin
if R_KEY_RED in FRulez then
PushItem(ITEM_KEY_RED);
if srv and (OldLR = LMS_RESPAWN_NONE) and (gLMSRespawn > LMS_RESPAWN_NONE) then
begin
if NetMode = NET_SERVER then
if srv and (OldLR = LMS_RESPAWN_NONE) and (gLMSRespawn > LMS_RESPAWN_NONE) then
begin
if NetMode = NET_SERVER then
- MH_SEND_GameEvent(NET_EV_LMS_WARMUP, (gLMSRespawnTime - gTime) div 1000)
+ MH_SEND_GameEvent(NET_EV_LMS_WARMUP, gLMSRespawnTime - gTime)
else
g_Console_Add(Format(_lc[I_MSG_WARMUP_START], [(gLMSRespawnTime - gTime) div 1000]), True);
end;
else
g_Console_Add(Format(_lc[I_MSG_WARMUP_START], [(gLMSRespawnTime - gTime) div 1000]), True);
end;
FMonsterKills := 0;
FDeath := 0;
FSecrets := 0;
FMonsterKills := 0;
FDeath := 0;
FSecrets := 0;
+ FSpawnInvul := 0;
FReady := False;
if FNoRespawn then
begin
FReady := False;
if FNoRespawn then
begin
FShellTimer := -1;
FPain := 0;
FLastHit := 0;
FShellTimer := -1;
FPain := 0;
FLastHit := 0;
+ FSpawnInvul := 0;
if not g_Game_IsServer then
Exit;
if not g_Game_IsServer then
Exit;
FSpectatePlayer := -1;
FSpawned := True;
FSpectatePlayer := -1;
FSpawned := True;
- if (gPlayer1 = nil) and (gLMSPID1 = FUID) then
+ if (gPlayer1 = nil) and (gSpectLatchPID1 = FUID) then
gPlayer1 := self;
gPlayer1 := self;
- if (gPlayer2 = nil) and (gLMSPID2 = FUID) then
+ if (gPlayer2 = nil) and (gSpectLatchPID2 = FUID) then
gPlayer2 := self;
if g_Game_IsNet then
gPlayer2 := self;
if g_Game_IsNet then
begin
if Self = gPlayer1 then
begin
begin
if Self = gPlayer1 then
begin
- gLMSPID1 := FUID;
+ gSpectLatchPID1 := FUID;
gPlayer1 := nil;
gPlayer1 := nil;
- end;
- if Self = gPlayer2 then
+ end
+ else if Self = gPlayer2 then
begin
begin
- gLMSPID2 := FUID;
+ gSpectLatchPID2 := FUID;
gPlayer2 := nil;
end;
end;
gPlayer2 := nil;
end;
end;
if FDirection = TDirection.D_LEFT then FAngle := ANGLE_LEFTDOWN else FAngle := ANGLE_RIGHTDOWN;
if FDirection = TDirection.D_LEFT then FAngle := ANGLE_LEFTDOWN else FAngle := ANGLE_RIGHTDOWN;
- if FIncCam > -120.0 * g_dbg_scale then DecMin(FIncCam, 5, Integer(-120.0 * g_dbg_scale));
+ if FIncCam > -120 then DecMin(FIncCam, 5, -120);
end;
procedure TPlayer.SeeUp();
end;
procedure TPlayer.SeeUp();
if FDirection = TDirection.D_LEFT then FAngle := ANGLE_LEFTUP else FAngle := ANGLE_RIGHTUP;
if FDirection = TDirection.D_LEFT then FAngle := ANGLE_LEFTUP else FAngle := ANGLE_RIGHTUP;
- if FIncCam < 120.0 * g_dbg_scale then IncMax(FIncCam, 5, Integer(120.0 * g_dbg_scale));
+ if FIncCam < 120 then IncMax(FIncCam, 5, 120);
end;
procedure TPlayer.SetAction(Action: Byte; Force: Boolean = False);
end;
procedure TPlayer.SetAction(Action: Byte; Force: Boolean = False);
if FMegaRulez[MR_INVUL] < gTime+PLAYER_INVUL_TIME then
begin
FMegaRulez[MR_INVUL] := gTime+PLAYER_INVUL_TIME;
if FMegaRulez[MR_INVUL] < gTime+PLAYER_INVUL_TIME then
begin
FMegaRulez[MR_INVUL] := gTime+PLAYER_INVUL_TIME;
+ FSpawnInvul := 0;
end;
ITEM_INVIS:
end;
ITEM_INVIS: