From: fgsfds Date: Thu, 27 Feb 2020 18:48:28 +0000 (+0300) Subject: generalize warmup stuff X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=36fd4e713dc3cc0d54fd94085af17a77f5078e11;p=d2df-sdl.git generalize warmup stuff --- diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index e7ee1d0..ac28f34 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -1994,7 +1994,7 @@ begin Result := False; // Ìîíñòð ñòàòè÷åí ïîêà èäåò warmup - if (gLMSRespawn = LMS_RESPAWN_WARMUP) then exit; + if (gLMSRespawn > LMS_RESPAWN_NONE) then exit; // Óìèðàåò, óìåð èëè âîñêðåøàåòñÿ => óðîí äåëàòü íåêîìó: if (FState = MONSTATE_DEAD) or (FState = MONSTATE_DIE) or (FState = MONSTATE_REVIVE) then @@ -2454,7 +2454,7 @@ begin fall := True; // Ìîíñòð ñòàòè÷åí ïîêà èäåò warmup - if (gLMSRespawn = LMS_RESPAWN_WARMUP) then exit; + if (gLMSRespawn > LMS_RESPAWN_NONE) then exit; // Ðûáû "ëåòàþò" òîëüêî â âîäå: if FMonsterType = MONSTER_FISH then @@ -3447,7 +3447,7 @@ begin fall := True; // Ìîíñòð ñòàòè÷åí ïîêà èäåò warmup - if (gLMSRespawn = LMS_RESPAWN_WARMUP) then exit; + if (gLMSRespawn > LMS_RESPAWN_NONE) then exit; // Ðûáû "ëåòàþò" òîëüêî â âîäå: if FMonsterType = MONSTER_FISH then diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index 6c3137a..c2e379b 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -495,7 +495,7 @@ begin else begin plr.Respawn(False); - if gLMSRespawn = LMS_RESPAWN_WARMUP then + if gLMSRespawn > LMS_RESPAWN_NONE then MH_SEND_GameEvent(NET_EV_LMS_WARMUP, gLMSRespawnTime - gTime, 'N', C.ID); end; end; diff --git a/src/game/g_player.pas b/src/game/g_player.pas index d9dd887..30a71f1 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -2766,7 +2766,7 @@ begin e_CharFont_PrintEx(gMenuSmallFont, X-16-tw, Y+32, s, _RGB(255, 0, 0)); end; - if gLMSRespawn = LMS_RESPAWN_WARMUP then + if gLMSRespawn > LMS_RESPAWN_NONE then begin s := _lc[I_GAME_WARMUP]; e_CharFont_GetSize(gMenuFont, s, tw, th); diff --git a/src/game/g_triggers.pas b/src/game/g_triggers.pas index 3cfca16..55057b6 100644 --- a/src/game/g_triggers.pas +++ b/src/game/g_triggers.pas @@ -1224,7 +1224,7 @@ begin if not Trigger.Enabled then exit; if (Trigger.TimeOut <> 0) and (actType <> ACTIVATE_CUSTOM) then exit; - if (gLMSRespawn = LMS_RESPAWN_WARMUP) then exit; + if (gLMSRespawn > LMS_RESPAWN_NONE) then exit; if (Trigger.exoCheck <> nil) then begin diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas index 498487d..632cb13 100644 --- a/src/game/g_weapons.pas +++ b/src/game/g_weapons.pas @@ -461,12 +461,12 @@ begin if (t <> HIT_FLAME) or (m.FFireTime = 0) or (vx <> 0) or (vy <> 0) then Result := m.Damage(d, vx, vy, SpawnerUID, t) else - Result := (gLMSRespawn <> LMS_RESPAWN_WARMUP); // don't hit monsters when it's warmup time + Result := (gLMSRespawn = LMS_RESPAWN_NONE); // don't hit monsters when it's warmup time if t = HIT_FLAME then m.CatchFire(SpawnerUID); end else - Result := (gLMSRespawn <> LMS_RESPAWN_WARMUP); // don't hit monsters when it's warmup time + Result := (gLMSRespawn = LMS_RESPAWN_NONE); // don't hit monsters when it's warmup time end;