summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bab60f8)
raw | patch | inline | side by side (parent: bab60f8)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 3 Sep 2017 16:13:09 +0000 (19:13 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 3 Sep 2017 17:06:20 +0000 (20:06 +0300) |
15 files changed:
index b7ddd2c5f06a46d8834afe1dcce0cbb54964aa3a..b88dfb603b61262459c5d260469b0ad013ecf198 100644 (file)
end;
Space: ShortInt;
Height: ShortInt;
- Live: Boolean;
+ alive: Boolean;
end;
TSavedTexture = record
if e_CharFonts <> nil then
for i := 0 to High(e_CharFonts) do
- if not e_CharFonts[i].Live then
+ if not e_CharFonts[i].alive then
begin
id := i;
Break;
end;
Space := sp;
- Live := True;
+ alive := True;
end;
Result := id;
for a := 0 to High(Chars) do
if Chars[a].TextureID <> -1 then e_DeleteTexture(Chars[a].TextureID);
- e_CharFonts[FontID].Live := False;
+ e_CharFonts[FontID].alive := False;
end;
procedure e_CharFont_RemoveAll();
diff --git a/src/game/g_basic.pas b/src/game/g_basic.pas
index 8069029bc2c8338113244ef0f753b50659652a5d..530bf8e4c2ea873385be3eb3403a548122bfdd8f 100644 (file)
--- a/src/game/g_basic.pas
+++ b/src/game/g_basic.pas
if gPlayers = nil then Exit;
for a := 0 to High(gPlayers) do
- if (gPlayers[a] <> nil) and gPlayers[a].Live then
+ if (gPlayers[a] <> nil) and gPlayers[a].alive then
if gPlayers[a].Collide(X, Y, Width, Height) then
begin
Result := True;
begin
p := g_Player_Get(UID);
if p = nil then Exit;
- if not p.Live then Exit;
+ if not p.alive then Exit;
o^ := p.Obj;
end;
begin
m := g_Monsters_ByUID(UID);
if m = nil then Exit;
- if not m.Live then Exit;
+ if not m.alive then Exit;
o^ := m.Obj;
end;
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 9ec96396134f776058e72cb7616103bd7a116501..a377122e143a16bf6b443b54e6fc381cb8ea9e07 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
result := false; // don't stop
with mon do
begin
- if Live then
+ if alive then
begin
// Ëåâûé âåðõíèé óãîë
aX := Obj.X div ScaleSz + 1;
// Ðèñóåì èãðîêîâ:
for a := 0 to High(gPlayers) do
if gPlayers[a] <> nil then with gPlayers[a] do
- if Live then begin
+ if alive then begin
// Ëåâûé âåðõíèé óãîë:
aX := Obj.X div ScaleSz + 1;
aY := Obj.Y div ScaleSz + 1;
end
else if cmd = 'd_monster' then
begin
- if gGameOn and (gPlayer1 <> nil) and (gPlayer1.Live) and (not g_Game_IsNet) then
+ if gGameOn and (gPlayer1 <> nil) and (gPlayer1.alive) and (not g_Game_IsNet) then
if Length(P) < 2 then
begin
g_Console_Add(cmd + ' [ID | Name] [behaviour]');
diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas
index 8bdbf88400547702ff9f29aff9e964f1e15d2276..bd8d9ae5567495f7b857f9f3a77575c024d4596a 100644 (file)
--- a/src/game/g_gfx.pas
+++ b/src/game/g_gfx.pas
state := TPartState.Normal;
floorY := Unknown;
ceilingY := Unknown;
+ wallEndY := Unknown;
if (velY = 0) then velY := 0.1;
if (accelY = 0) then accelY := 0.5;
end;
TPartType.Water: result := (Random(30) = 15);
else raise Exception.Create('internal error in particle engine: drip');
end;
- if result then begin velY := 0.5; accelY := 0.15; end;
+ if result then
+ begin
+ velY := 0.5;
+ accelY := 0.15;
+ // if we're falling from ceiling, switch to normal mode
+ if (state = TPartState.Stuck) and (stickDX = 0) then state := TPartState.Normal;
+ end;
end;
// switch to freefall mode
procedure applyGravity (inLiquid: Boolean);
begin
state := TPartState.Normal;
- if (inLiquid) then
+ if inLiquid then
begin
velY := 0.5;
accelY := 0.15;
end;
label
- _done;
+ _done, _gravityagain, _stuckagain;
var
pan: TPanel;
dX, dY: SmallInt;
ex, ey: Integer;
checkEnv: Boolean;
+ floorJustTraced: Boolean;
begin
if not gpart_dbg_phys_enabled then goto _done;
else
begin
// stuck to a wall
- assert(wallEndY <> Unknown);
+ if (wallEndY = Unknown) then
+ begin
+ // this can happen if mplat was moved out; find new `wallEndY`
+ findFloor(true); // force trace, just in case
+ if (floorType = TFloorType.LiquidOut) then env := TEnvType.ELiquid else env := TEnvType.EAir;
+ mapGrid.traceOrthoRayWhileIn(ex, wallEndY, x+stickDX, y, x+stickDX, floorY+1, (GridTagWall or GridTagDoor or GridTagStep));
+ end;
+ _stuckagain:
// floor transition?
if (wallEndY <= floorY) and (y >= floorY) then
begin
case floorType of
TFloorType.Wall: // hit the ground
begin
- sleep();
- goto _done; // nothing to do anymore
+ // check if our ground wasn't moved since the last scan
+ findFloor(true); // force trace
+ if (y = floorY) then
+ begin
+ sleep();
+ goto _done; // nothing to do anymore
+ end;
+ // otherwise, do it again
+ goto _stuckagain;
end;
TFloorType.LiquidIn: // entering the liquid
begin
// gravity, if not stuck
if (state <> TPartState.Stuck) and (abs(velX) < 0.1) and (abs(velY) < 0.1) then
begin
- if (floorY = Unknown) then findFloor();
+ floorJustTraced := (floorY = Unknown);
+ if floorJustTraced then findFloor();
+ _gravityagain:
// floor transition?
if (y = floorY) then
begin
case floorType of
TFloorType.Wall: // hit the ground
begin
- // nothing to do
+ // check if our ground wasn't moved since the last scan
+ if not floorJustTraced then
+ begin
+ findFloor(true); // force trace
+ if (floorType = TFloorType.LiquidOut) then env := TEnvType.ELiquid else env := TEnvType.EAir;
+ if (y <> floorY) then goto _gravityagain;
+ end;
+ // otherwise, nothing to do
end;
TFloorType.LiquidIn: // entering the liquid
begin
while (dY > 0) do
begin
// falling down
- if (floorY = Unknown) then findFloor(); // need to do this anyway
+ floorJustTraced := (floorY = Unknown);
+ if floorJustTraced then findFloor();
if (floorType = TFloorType.LiquidOut) then env := TEnvType.ELiquid else env := TEnvType.EAir;
y += dY;
//e_LogWritefln('floorY=%s; newy=%s; dY=%s; floorType=%s', [floorY, y, dY, floorType]);
case floorType of
TFloorType.Wall: // hit the ground
begin
+ // check if our ground wasn't moved since the last scan
+ if not floorJustTraced then
+ begin
+ e_LogWritefln('force rescanning vpart at (%d,%d); floorY=%d', [x, y, floorY]);
+ findFloor(true); // force trace
+ e_LogWritefln(' rescanned vpart at (%d,%d); floorY=%d', [x, y, floorY]);
+ if (floorType = TFloorType.LiquidOut) then env := TEnvType.ELiquid else env := TEnvType.EAir;
+ if (y <> floorY) then continue;
+ end;
// environment didn't changed
hitAFloor();
break; // done with vertical movement
procedure g_GFX_Draw ();
var
a, len: Integer;
+ scaled: Boolean;
begin
if not gpart_dbg_enabled then exit;
glBegin(GL_POINTS);
+ scaled := (g_dbg_scale <> 1.0);
+
len := High(Particles);
for a := 0 to len do
begin
with Particles[a] do
begin
- if alive and (x >= sX) and (y >= sY) and (x <= sX+sWidth) and (sY <= sY+sHeight) then
+ if not alive then continue;
+ if scaled or ((x >= sX) and (y >= sY) and (x <= sX+sWidth) and (sY <= sY+sHeight)) then
begin
glColor4ub(red, green, blue, alpha);
glVertex2f(x+0.37, y+0.37);
diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index a534e7a3919ec48467373a5df82975b55632ed91..42f52c51ecbed1abe90d4db45678a3ad218d781a 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
msY: Integer = -666;
msB: Word = 0; // button state
kbS: Word = 0; // keyboard modifiers state
- showGrid: Boolean = {$IF DEFINED(D2F_DEBUG)}true{$ELSE}false{$ENDIF};
+ showGrid: Boolean = {$IF DEFINED(D2F_DEBUG)}false{$ELSE}false{$ENDIF};
showMonsInfo: Boolean = false;
showMonsLOS2Plr: Boolean = false;
showAllMonsCells: Boolean = false;
diff --git a/src/game/g_items.pas b/src/game/g_items.pas
index e07944a35306562840d567732f3efbf5dfc0e877..c7565417c799ce2952c103a6c881e3cc53506d0a 100644 (file)
--- a/src/game/g_items.pas
+++ b/src/game/g_items.pas
Respawnable: Boolean;
InitX, InitY: Integer;
RespawnTime: Word;
- Live: Boolean;
+ alive: Boolean;
Fall: Boolean;
QuietRespawn: Boolean;
SpawnTrigger: Integer;
it.Animation.Free();
it.Animation := nil;
end;
- it.Live := False;
+ it.alive := False;
it.SpawnTrigger := -1;
it.ItemType := ITEM_NONE;
freeIds.release(LongWord(idx));
it.arrIdx := i;
it.ItemType := ITEM_NONE;
it.Animation := nil;
- it.Live := false;
+ it.alive := false;
it.SpawnTrigger := -1;
it.Respawnable := false;
//if not freeIds.hasFree[LongWord(i)] then raise Exception.Create('internal error in item idx manager');
it.InitY := Y;
it.RespawnTime := 0;
it.Fall := Fall;
- it.Live := True;
+ it.alive := True;
it.QuietRespawn := False;
g_Obj_Init(@it.Obj);
begin
nxt := False;
- if Live then
+ if alive then
begin
if Fall then
begin
Inc(j);
if j > High(gPlayers) then j := 0;
- if (gPlayers[j] <> nil) and gPlayers[j].Live and g_Obj_Collide(@gPlayers[j].Obj, @Obj) then
+ if (gPlayers[j] <> nil) and gPlayers[j].alive and g_Obj_Collide(@gPlayers[j].Obj, @Obj) then
begin
if g_Game_IsClient then continue;
if Respawnable and g_Game_IsServer then
begin
DecMin(RespawnTime, 0);
- if (RespawnTime = 0) and (not Live) then
+ if (RespawnTime = 0) and (not alive) then
begin
if not QuietRespawn then g_Sound_PlayExAt('SOUND_ITEM_RESPAWNITEM', InitX, InitY);
Obj.Accel.Y := 0;
positionChanged(); // this updates spatial accelerators
- Live := true;
+ alive := true;
if g_Game_IsNet then MH_SEND_ItemSpawn(QuietRespawn, i);
QuietRespawn := false;
for i := 0 to High(ggItems) do
begin
- if not ggItems[i].Live then continue;
+ if not ggItems[i].alive then continue;
with ggItems[i] do
begin
procedure g_Items_Pick (ID: DWORD);
begin
- ggItems[ID].Live := false;
+ ggItems[ID].alive := false;
ggItems[ID].RespawnTime := ITEM_RESPAWNTIME;
end;
// Âðåìÿ äî ðåñïàóíà
Mem.WriteWord(ggItems[i].RespawnTime);
// Ñóùåñòâóåò ëè ýòîò ïðåäìåò
- Mem.WriteBoolean(ggItems[i].Live);
+ Mem.WriteBoolean(ggItems[i].alive);
// Ìîæåò ëè îí ïàäàòü
Mem.WriteBoolean(ggItems[i].Fall);
// Èíäåêñ òðèããåðà, ñîçäàâøåãî ïðåäìåò
// Âðåìÿ äî ðåñïàóíà
Mem.ReadWord(ggItems[i].RespawnTime);
// Ñóùåñòâóåò ëè ýòîò ïðåäìåò
- Mem.ReadBoolean(ggItems[i].Live);
+ Mem.ReadBoolean(ggItems[i].alive);
// Ìîæåò ëè îí ïàäàòü
Mem.ReadBoolean(ggItems[i].Fall);
// Èíäåêñ òðèããåðà, ñîçäàâøåãî ïðåäìåò
begin
for idx := High(ggItems) downto 0 do
begin
- if ggItems[idx].Live then
+ if ggItems[idx].alive then
begin
result := cb(@ggItems[idx]);
if result then exit;
begin
for idx := 0 to High(ggItems) do
begin
- if ggItems[idx].Live then
+ if ggItems[idx].alive then
begin
result := cb(@ggItems[idx]);
if result then exit;
for f := 0 to High(ggItems) do
begin
it := @ggItems[f];
- if not it.Live then continue;
+ if not it.alive then continue;
case it.ItemType of
ITEM_KEY_RED: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 24, 1.0, 0.0, 0.0, 0.6);
ITEM_KEY_GREEN: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 24, 0.0, 1.0, 0.0, 0.6);
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index 4b197e3ec74bf4e2ddbec3750e4624798ab307ab..50b0d2669ae576f4647c599664b6d7c38dc094d2 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
if j > High(gPlayers) then j := 0;
if gPlayers[j] <> nil then
begin
- if gPlayers[j].Live and g_Obj_Collide(@Obj, @gPlayers[j].Obj) then
+ if gPlayers[j].alive and g_Obj_Collide(@Obj, @gPlayers[j].Obj) then
begin
if gPlayers[j].GetFlag(a) then Break;
end;
diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index 93666fa87f3f4f4a9da3c5fe71a195b871af8533..a84251949474de22ad1a163b41c767f5eb2d52e0 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
begin
Enabled := True;
if (gGameSettings.GameType = GT_SINGLE) and
- ((gPlayer1 = nil) or (not gPlayer1.Live)) and
- ((gPlayer2 = nil) or (not gPlayer2.Live)) then
+ ((gPlayer1 = nil) or (not gPlayer1.alive)) and
+ ((gPlayer2 = nil) or (not gPlayer2.alive)) then
Enabled := False; // Îäèí èç èãðîêîâ ïîãèá â ñèíãëå
if not gGameOn then
Enabled := False; // Çàïðåòèòü ñîõðàíåíèå â èíòåðìèññèè (íå ðåàëèçîâàíî)
index a437ff9bdcd13e7c1ea72bc56b75efe61c4a72cb..5719ca4ff300322779f697deeb1bbb08510a196b 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
function Collide(Panel: TPanel): Boolean; overload;
function Collide(X, Y: Integer): Boolean; overload;
function TeleportTo(X, Y: Integer; silent: Boolean; dir: Byte): Boolean;
- function Live(): Boolean;
+ function alive(): Boolean;
procedure SetHealth(aH: Integer);
procedure Push(vx, vy: Integer);
function Damage(aDamage: Word; VelX, VelY: Integer; SpawnerUID: Word; t: Byte): Boolean;
Result := False;
if g_Game_IsClient then
Exit;
- if not Live then
+ if not alive then
Exit;
if FHealth < FMaxHealth then
(FObj.X > gMapInfo.Width+1000) or (FObj.Y < -1000) then
begin
FRemoved := True;
- if Live and (gLMSRespawn = LMS_RESPAWN_NONE) then
+ if alive and (gLMSRespawn = LMS_RESPAWN_NONE) then
begin
Inc(gCoopMonstersKilled);
if g_Game_IsNet then
// Åñëè åñòü èãðîê ðÿäîì, ïðîñûïàåìñÿ è èäåì ê íåìó:
if (gPlayers <> nil) then
for a := 0 to High(gPlayers) do
- if (gPlayers[a] <> nil) and (gPlayers[a].Live)
+ if (gPlayers[a] <> nil) and (gPlayers[a].alive)
and (not gPlayers[a].NoTarget) and (gPlayers[a].FMegaRulez[MR_INVIS] < gTime) then
with gPlayers[a] do
if g_Look(@FObj, @Obj, FDirection) then
// Åñëè åñòü ïîäõîäÿùèé ìîíñòð ðÿäîì:
if gMonsters <> nil then
for a := 0 to High(gMonsters) do
- if (gMonsters[a] <> nil) and (gMonsters[a].Live) and
+ if (gMonsters[a] <> nil) and (gMonsters[a].alive) and
(gMonsters[a].FUID <> FUID) then
begin
// Ìàíüÿêè íàïàäàþò íà âñåõ ìîíñòðîâ, êðîìå äðóçåé
if b > 1 then b := b * (Random(8 div b) + 1);
for a := 0 to High(gGibs) do
begin
- if gGibs[a].Live and
+ if gGibs[a].alive and
g_Obj_Collide(FObj.X+FObj.Rect.X, FObj.Y+FObj.Rect.Y+FObj.Rect.Height-4,
FObj.Rect.Width, 8, @gGibs[a].Obj) and (Random(3) = 0) then
begin
if b > 1 then b := b * (Random(8 div b) + 1);
for a := 0 to High(gGibs) do
begin
- if gGibs[a].Live and
+ if gGibs[a].alive and
g_Obj_Collide(FObj.X+FObj.Rect.X, FObj.Y+FObj.Rect.Y+FObj.Rect.Height-4,
FObj.Rect.Width, 8, @gGibs[a].Obj) and (Random(3) = 0) then
begin
if (gPlayers <> nil) and (FBehaviour <> BH_INSANE) and
(FBehaviour <> BH_CANNIBAL) and (FBehaviour <> BH_GOOD) then
for a := 0 to High(gPlayers) do
- if (gPlayers[a] <> nil) and (gPlayers[a].Live)
+ if (gPlayers[a] <> nil) and (gPlayers[a].alive)
and (not gPlayers[a].NoTarget) and (gPlayers[a].FMegaRulez[MR_INVIS] < gTime) then
begin
if g_Look(@FObj, @gPlayers[a].Obj, FDirection) then
// Êèëëåðû è äîáðûå íå òðîãàþò ìîíñòðîâ
if (gMonsters <> nil) and (FBehaviour <> BH_KILLER) and (FBehaviour <> BH_GOOD) then
for a := 0 to High(gMonsters) do
- if (gMonsters[a] <> nil) and (gMonsters[a].Live) and
+ if (gMonsters[a] <> nil) and (gMonsters[a].alive) and
(gMonsters[a].FUID <> FUID) then
begin
if (FBehaviour = BH_CANNIBAL) and (gMonsters[a].FMonsterType <> FMonsterType) then
Result := True;
end;
-function TMonster.Live(): Boolean;
+function TMonster.alive(): Boolean;
begin
Result := (FState <> MONSTATE_DIE) and (FState <> MONSTATE_DEAD) and (FHealth > 0);
end;
for idx := 0 to High(gMonsters) do
begin
mon := gMonsters[idx];
- if (mon <> nil) and mon.Live then
+ if (mon <> nil) and mon.alive then
begin
result := cb(mon);
if result then exit;
@@ -4590,7 +4590,7 @@ function g_Mons_IsAnyAliveAt (x, y: Integer; width, height: Integer): Boolean;
function monsCollCheck (mon: TMonster; atag: Integer): Boolean;
begin
- result := mon.Live;// and g_Obj_Collide(x, y, width, height, @mon.Obj));
+ result := mon.alive;// and g_Obj_Collide(x, y, width, height, @mon.Obj));
end;
var
for idx := 0 to High(gMonsters) do
begin
mon := gMonsters[idx];
- if (mon <> nil) and mon.Live then
+ if (mon <> nil) and mon.alive then
begin
if g_Obj_Collide(x, y, width, height, @mon.Obj) then
begin
for idx := 0 to High(gMonsters) do
begin
mon := gMonsters[idx];
- if (mon <> nil) and mon.Live then
+ if (mon <> nil) and mon.alive then
begin
if g_Obj_Collide(x, y, width, height, @mon.Obj) then
begin
@@ -4661,8 +4661,8 @@ function g_Mons_ForEachAliveAt (x, y: Integer; width, height: Integer; cb: TEach
function monsCollCheck (mon: TMonster; atag: Integer): Boolean;
begin
//result := false;
- //if mon.Live and g_Obj_Collide(x, y, width, height, @mon.Obj) then result := cb(mon);
- if mon.Live then result := cb(mon) else result := false;
+ //if mon.alive and g_Obj_Collide(x, y, width, height, @mon.Obj) then result := cb(mon);
+ if mon.alive then result := cb(mon) else result := false;
end;
var
for idx := 0 to High(gMonsters) do
begin
mon := gMonsters[idx];
- if (mon <> nil) and mon.Live then
+ if (mon <> nil) and mon.alive then
begin
if g_Obj_Collide(x, y, width, height, @mon.Obj) then
begin
diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index 33d16522865e7e122b6bdbe9e7f9c76c90c43b74..21046a048064e930129811bc684715206448f37c 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
with P do
begin
- NetOut.Write(Byte(Live));
+ NetOut.Write(Byte(alive));
NetOut.Write(Byte(GodMode));
NetOut.Write(Health);
NetOut.Write(Armor);
with Pl do
begin
- Live := (M.ReadByte() <> 0);
+ alive := (M.ReadByte() <> 0);
GodMode := (M.ReadByte() <> 0);
Health := M.ReadLongInt();
Armor := M.ReadLongInt();
SHID := M.ReadLongInt();
with Pl do
- if Live then NetFire(Weap, X, Y, AX, AY, SHID);
+ if alive then NetFire(Weap, X, Y, AX, AY, SHID);
end;
procedure MC_RECV_PlayerSettings(var M: TMsg);
diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas
index 809f78152feebf04a2591457eda8e4ec257b1963..0a3f8f7900c6f417115570d89c89a581ecb035e5 100644 (file)
--- a/src/game/g_panel.pas
+++ b/src/game/g_panel.pas
var
px, py, pw, ph, dx, dy: Integer;
begin
- if (plr = nil) then exit;
+ // dead players leaves separate body entities, so don't move 'em
+ if (plr = nil) or not plr.alive then exit;
plr.getMapBox(px, py, pw, ph);
if (py+ph <> Y) then
begin
plr.GameY := plr.GameY+dy;
plr.positionChanged();
// check if we're squashed
- if plr.live then
+ if plr.alive then
begin
plr.getMapBox(px, py, pw, ph);
if g_Map_CollidePanel(px, py, pw, ph, (PANEL_WALL or PANEL_OPENDOOR or PANEL_CLOSEDOOR)) then
begin
mon := monMoveList[f];
// check if it is squashed
- if mon.live then
+ if mon.alive then
begin
mon.getMapBox(px, py, pw, ph);
if g_Map_CollidePanel(px, py, pw, ph, (PANEL_WALL or PANEL_OPENDOOR or PANEL_CLOSEDOOR)) then
diff --git a/src/game/g_phys.pas b/src/game/g_phys.pas
index a16abeef71f0a1341d554f97275dacf24fdb7561..41fdfddc5d2517d45849265c1da176e17bd23920 100644 (file)
--- a/src/game/g_phys.pas
+++ b/src/game/g_phys.pas
for plr in gPlayers do
begin
if (plr = nil) then continue;
- if not plr.Live then continue;
+ if not plr.alive then continue;
with plr do
begin
if g_Collide(GameX+PLAYER_RECT.X, GameY+PLAYER_RECT.Y,
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 04719fccc88dca671b0e98a9838a388f55d7170f..1c01e2f032ae7750f7531d20322c569baac24623 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
FUID: Word;
FName: String;
FTeam: Byte;
- FLive: Boolean;
+ FAlive: Boolean;
FSpawned: Boolean;
FDirection: TDirection;
FHealth: Integer;
property GodMode: Boolean read FGodMode write FGodMode;
property NoTarget: Boolean read FNoTarget write FNoTarget;
property NoReload: Boolean read FNoReload write FNoReload;
- property Live: Boolean read FLive write FLive;
+ property alive: Boolean read FAlive write FAlive;
property Flag: Byte read FFlag;
property Team: Byte read FTeam write FTeam;
property Direction: TDirection read FDirection;
end;
TGib = record
- Live: Boolean;
+ alive: Boolean;
ID: DWORD;
MaskID: DWORD;
RAngle: Integer;
TShell = record
SpriteID: DWORD;
- Live: Boolean;
+ alive: Boolean;
SType: Byte;
RAngle: Integer;
Timeout: Cardinal;
gPlayers[a].FModel.Color := Color;
gPlayers[a].FUID := g_CreateUID(UID_PLAYER);
- gPlayers[a].FLive := False;
+ gPlayers[a].FAlive := False;
Result := gPlayers[a].FUID;
end;
Mem.ReadByte(gPlayers[a].FTeam);
gPlayers[a].FPreferredTeam := gPlayers[a].FTeam;
// Æèâ ëè:
- Mem.ReadBoolean(gPlayers[a].FLive);
+ Mem.ReadBoolean(gPlayers[a].FAlive);
// Èçðàñõîäîâàë ëè âñå æèçíè:
Mem.ReadBoolean(gPlayers[a].FNoRespawn);
// Íàïðàâëåíèå:
i: Integer;
begin
for i := Low(gPlayers) to High(gPlayers) do
- if (gPlayers[i] <> nil) and gPlayers[i].Live then
+ if (gPlayers[i] <> nil) and gPlayers[i].alive then
gPlayers[i].RememberState;
end;
find_id: DWORD;
ok: Boolean;
begin
- if Player.Live then
+ if Player.alive then
Exit;
if Player.FObj.Y >= gMapInfo.Height+128 then
Exit;
Obj.Rect.Height := 3;
end;
SType := T;
- Live := True;
+ alive := True;
Obj.X := fX;
Obj.Y := fY;
g_Obj_Push(@Obj, dX + Random(4)-Random(4), dY-Random(4));
Color := fColor;
ID := GibsArray[a].ID;
MaskID := GibsArray[a].MaskID;
- Live := True;
+ alive := True;
g_Obj_Init(@Obj);
Obj.Rect := GibsArray[a].Rect;
Obj.X := fX-GibsArray[a].Rect.X-(GibsArray[a].Rect.Width div 2);
// Êóñêè ìÿñà:
if gGibs <> nil then
for i := 0 to High(gGibs) do
- if gGibs[i].Live then
+ if gGibs[i].alive then
with gGibs[i] do
begin
vel := Obj.Vel;
if WordBool(mr and MOVE_FALLOUT) then
begin
- Live := False;
+ alive := False;
Continue;
end;
// Ãèëüçû:
if gShells <> nil then
for i := 0 to High(gShells) do
- if gShells[i].Live then
+ if gShells[i].alive then
with gShells[i] do
begin
vel := Obj.Vel;
if WordBool(mr and MOVE_FALLOUT) or (gShells[i].Timeout < gTime) then
begin
- Live := False;
+ alive := False;
Continue;
end;
begin
if gGibs <> nil then
for i := 0 to High(gGibs) do
- if gGibs[i].Live then
+ if gGibs[i].alive then
with gGibs[i] do
begin
if not g_Obj_Collide(sX, sY, sWidth, sHeight, @Obj) then
begin
if gShells <> nil then
for i := 0 to High(gShells) do
- if gShells[i].Live then
+ if gShells[i].alive then
with gShells[i] do
begin
if not g_Obj_Collide(sX, sY, sWidth, sHeight, @Obj) then
Exit;
if not (gGameSettings.GameMode in [GM_TDM, GM_CTF]) then Exit;
- if gGameOn and FLive then
+ if gGameOn and FAlive then
Kill(K_SIMPLEKILL, FUID, HIT_SELF);
if FTeam = TEAM_RED then
r: Boolean;
begin
if gItems = nil then Exit;
- if not FLive then Exit;
+ if not FAlive then Exit;
for i := 0 to High(gItems) do
with gItems[i] do
begin
- if (ItemType <> ITEM_NONE) and Live then
+ if (ItemType <> ITEM_NONE) and alive then
if g_Obj_Collide(FObj.X+PLAYER_RECT.X, FObj.Y+PLAYER_RECT.Y, PLAYER_RECT.Width,
PLAYER_RECT.Height, @Obj) then
begin
@@ -2054,7 +2054,7 @@ procedure TPlayer.Damage(value: Word; SpawnerUID: Word; vx, vy: Integer; t: Byte
var
c: Word;
begin
- if (not g_Game_IsClient) and (not FLive) then
+ if (not g_Game_IsClient) and (not FAlive) then
Exit;
FLastHit := t;
end;
// Áóôåð óðîíà:
- if FLive then
+ if FAlive then
Inc(FDamageBuffer, value);
// Âñïûøêà áîëè:
Result := False;
if g_Game_IsClient then
Exit;
- if not FLive then
+ if not FAlive then
Exit;
if Soft and (FHealth < PLAYER_HP_SOFT) then
w, h: Word;
dr: Boolean;
begin
- if FLive then
+ if FAlive then
begin
if (FMegaRulez[MR_INVUL] > gTime) and (gPlayerDrawn <> Self) then
if g_Texture_Get('TEXTURE_PLAYER_INVULPENTA', ID) then
if (gChatBubble > 0) and (FKeys[KEY_CHAT].Pressed) and not FGhost then
DrawBubble();
// e_DrawPoint(5, 335, 288, 255, 0, 0); // DL, UR, DL, UR
- if gAimLine and Live and
+ if gAimLine and alive and
((Self = gPlayer1) or (Self = gPlayer2)) then
DrawAim();
end;
Srv := g_Game_IsServer;
Netsrv := g_Game_IsServer and g_Game_IsNet;
if Srv then FDeath := FDeath + 1;
- if FLive then
+ if FAlive then
begin
if FGhost then
FGhost := False;
if not FPhysics then
FPhysics := True;
- FLive := False;
+ FAlive := False;
end;
FShellTimer := -1;
procedure TPlayer.Touch();
begin
- if not FLive then
+ if not FAlive then
Exit;
//FModel.PlaySound(MODELSOUND_PAIN, 1, FObj.X, FObj.Y);
if FIamBot then
procedure TPlayer.Reset(Force: Boolean);
begin
if Force then
- FLive := False;
+ FAlive := False;
FSpawned := False;
FTime[T_RESPAWN] := 0;
if Force then
begin
FTime[T_RESPAWN] := 0;
- FLive := False;
+ FAlive := False;
end;
FNetTime := 0;
// if server changes MaxLives we gotta be ready
SetFlag(FLAG_NONE);
// Âîñêðåøåíèå áåç îðóæèÿ:
- if not FLive then
+ if not FAlive then
begin
FHealth := PLAYER_HP_SOFT;
FArmor := 0;
- FLive := True;
+ FAlive := True;
FAir := AIR_DEF;
FJetFuel := 0;
procedure TPlayer.Spectate(NoMove: Boolean = False);
begin
- if FLive then
+ if FAlive then
Kill(K_EXTRAHARDKILL, FUID, HIT_SOME)
else if (not NoMove) then
begin
FXTo := GameX;
FYTo := GameY;
- FLive := False;
+ FAlive := False;
FSpectator := True;
FGhost := True;
FPhysics := False;
procedure TPlayer.SwitchNoClip;
begin
- if not FLive then
+ if not FAlive then
Exit;
FGhost := not FGhost;
FPhysics := not FGhost;
if b > 1 then b := b * (Random(8 div b) + 1);
for a := 0 to High(gGibs) do
begin
- if gGibs[a].Live and
+ if gGibs[a].alive and
g_Obj_Collide(FObj.X+FObj.Rect.X, FObj.Y+FObj.Rect.Y+FObj.Rect.Height-4,
FObj.Rect.Width, 8, @gGibs[a].Obj) and (Random(3) = 0) then
begin
FObj.X := X-PLAYER_RECT.X;
FObj.Y := Y-PLAYER_RECT.Y;
- if FLive and FGhost then
+ if FAlive and FGhost then
begin
FXTo := FObj.X;
FYTo := FObj.Y;
FLoss := 0;
end;
- if FLive and (gFly or FJetpack) then
+ if FAlive and (gFly or FJetpack) then
FlySmoke();
if FDirection = D_LEFT then
else
FAngle := 0;
- if FLive and (not FGhost) then
+ if FAlive and (not FGhost) then
begin
if FKeys[KEY_UP].Pressed then
SeeUp();
end;
// no need to do that each second frame, weapon queue will take care of it
- if FLive and FKeys[KEY_NEXTWEAPON].Pressed and AnyServer then NextWeapon();
- if FLive and FKeys[KEY_PREVWEAPON].Pressed and AnyServer then PrevWeapon();
+ if FAlive and FKeys[KEY_NEXTWEAPON].Pressed and AnyServer then NextWeapon();
+ if FAlive and FKeys[KEY_PREVWEAPON].Pressed and AnyServer then PrevWeapon();
if gTime mod (GAME_TICK*2) <> 0 then
begin
- if (FObj.Vel.X = 0) and FLive then
+ if (FObj.Vel.X = 0) and FAlive then
begin
if FKeys[KEY_LEFT].Pressed then
Run(D_LEFT);
FActionChanged := False;
- if FLive then
+ if FAlive then
begin
// Let alive player do some actions
if FKeys[KEY_LEFT].Pressed then Run(D_LEFT);
Respawn(False)
else // Single
if (FTime[T_RESPAWN] <= gTime) and
- gGameOn and (not FLive) then
+ gGameOn and (not FAlive) then
begin
if (g_Player_GetCount() > 1) then
Respawn(False)
SetSpect := False;
for I := FSpectatePlayer + 1 to High(gPlayers) do
if gPlayers[I] <> nil then
- if gPlayers[I].Live then
+ if gPlayers[I].alive then
if gPlayers[I].UID <> FUID then
begin
FSpectatePlayer := I;
if FSpectator then
if (FSpectatePlayer <= High(gPlayers)) and (FSpectatePlayer >= 0) then
if gPlayers[FSpectatePlayer] <> nil then
- if gPlayers[FSpectatePlayer].Live then
+ if gPlayers[FSpectatePlayer].alive then
begin
FXTo := gPlayers[FSpectatePlayer].GameX;
FYTo := gPlayers[FSpectatePlayer].GameY;
headwater := HeadInLiquid(0, 0);
// Ñîïðîòèâëåíèå âîçäóõà:
- if (not FLive) or not (FKeys[KEY_LEFT].Pressed or FKeys[KEY_RIGHT].Pressed) then
+ if (not FAlive) or not (FKeys[KEY_LEFT].Pressed or FKeys[KEY_RIGHT].Pressed) then
if FObj.Vel.X <> 0 then
FObj.Vel.X := z_dec(FObj.Vel.X, 1);
DecMin(FPain, 5, 0);
DecMin(FPickup, 1, 0);
- if FLive and (FObj.Y > Integer(gMapInfo.Height)+128) and AnyServer then
+ if FAlive and (FObj.Y > Integer(gMapInfo.Height)+128) and AnyServer then
begin
// Îáíóëèòü äåéñòâèÿ ïðèìî÷åê, ÷òîáû ôîí ïðîïàë
FMegaRulez[MR_SUIT] := 0;
i := 9;
- if FLive then
+ if FAlive then
begin
if FCurrWeap = WEAPON_SAW then
if not (FSawSound.IsPlaying() or FSawSoundHit.IsPlaying() or
else if FHealth > -50 then Kill(K_HARDKILL, FLastSpawnerUID, FLastHit)
else Kill(K_EXTRAHARDKILL, FLastSpawnerUID, FLastHit);
- if FLive then
+ if FAlive then
begin
if FDamageBuffer <= 20 then FModel.PlaySound(MODELSOUND_PAIN, 1, FObj.X, FObj.Y)
else if FDamageBuffer <= 55 then FModel.PlaySound(MODELSOUND_PAIN, 2, FObj.X, FObj.Y)
end;
{CollideItem();}
- end; // if FLive then ...
+ end; // if FAlive then ...
if (FActionAnim = A_PAIN) and (FModel.Animation <> A_PAIN) then
begin
for a := 0 to High(gPlayers) do
if (gPlayers[a] <> nil) and (gPlayers[a] <> Self) and
- gPlayers[a].Live and SameTeam(FUID, gPlayers[a].FUID) and
+ gPlayers[a].alive and SameTeam(FUID, gPlayers[a].FUID) and
g_Obj_Collide(FObj.X+FObj.Rect.X, FObj.Y+FObj.Rect.Y,
FObj.Rect.Width, FObj.Rect.Height, @gPlayers[a].FObj) then
begin
// Êîìàíäà:
Mem.WriteByte(FTeam);
// Æèâ ëè:
- Mem.WriteBoolean(FLive);
+ Mem.WriteBoolean(FAlive);
// Èçðàñõîäîâàë ëè âñå æèçíè:
Mem.WriteBoolean(FNoRespawn);
// Íàïðàâëåíèå:
// Êîìàíäà:
Mem.ReadByte(FTeam);
// Æèâ ëè:
- Mem.ReadBoolean(FLive);
+ Mem.ReadBoolean(FAlive);
// Èçðàñõîäîâàë ëè âñå æèçíè:
Mem.ReadBoolean(FNoRespawn);
// Íàïðàâëåíèå:
function monsUpdate (mon: TMonster): Boolean;
begin
result := false; // don't stop
- if mon.Live and (mon.MonsterType <> MONSTER_BARREL) then
+ if mon.alive and (mon.MonsterType <> MONSTER_BARREL) then
begin
if not TargetOnScreen(mon.Obj.X+mon.Obj.Rect.X, mon.Obj.Y+mon.Obj.Rect.Y) then exit;
// Èãðîêè:
if vsPlayer then
for a := 0 to High(gPlayers) do
- if (gPlayers[a] <> nil) and (gPlayers[a].Live) and
+ if (gPlayers[a] <> nil) and (gPlayers[a].alive) and
(gPlayers[a].FUID <> FUID) and
(not SameTeam(FUID, gPlayers[a].FUID)) and
(not gPlayers[a].NoTarget) and
if Target.IsPlayer then
begin // Öåëü - èãðîê
pla := g_Player_Get(Target.UID);
- if (pla = nil) or (not pla.Live) or pla.NoTarget or
+ if (pla = nil) or (not pla.alive) or pla.NoTarget or
(pla.FMegaRulez[MR_INVIS] >= gTime) then
Target.UID := 0; // òî çàáûòü öåëü
end
else
begin // Öåëü - ìîíñòð
mon := g_Monsters_ByUID(Target.UID);
- if (mon = nil) or (not mon.Live) then
+ if (mon = nil) or (not mon.alive) then
Target.UID := 0; // òî çàáûòü öåëü
end;
end;
var
EnableAI: Boolean;
begin
- if not FLive then
+ if not FAlive then
begin // Respawn
ReleaseKeys();
PressKey(KEY_UP);
index 1c8a586126ee9f15517ffba8d288b0245aa7254b..2da3a1e8dcdb267c264d22ef5fbd916845927085 100644 (file)
--- a/src/game/g_triggers.pas
+++ b/src/game/g_triggers.pas
begin
for a := 0 to High(gPlayers) do
begin
- if (gPlayers[a] <> nil) and gPlayers[a].Live and gPlayers[a].Collide(X, Y, Width, Height) then
+ if (gPlayers[a] <> nil) and gPlayers[a].alive and gPlayers[a].Collide(X, Y, Width, Height) then
begin
gPlayers[a].Damage(TRAP_DAMAGE, 0, 0, 0, HIT_TRAP);
end;
begin
for a := 0 to High(gPlayers) do
begin
- if (gPlayers[a] <> nil) and gPlayers[a].Live and gPlayers[a].Collide(X, Y, Width, Height) then
+ if (gPlayers[a] <> nil) and gPlayers[a].alive and gPlayers[a].Collide(X, Y, Width, Height) then
begin
gPlayers[a].Damage(TRAP_DAMAGE, 0, 0, 0, HIT_TRAP);
end;
(*
if gMonsters <> nil then
for a := 0 to High(gMonsters) do
- if (gMonsters[a] <> nil) and gMonsters[a].Live and
+ if (gMonsters[a] <> nil) and gMonsters[a].alive and
g_Obj_Collide(X, Y, Width, Height, @gMonsters[a].Obj) then
gMonsters[a].Damage(TRAP_DAMAGE, 0, 0, 0, HIT_TRAP);
*)
function monsShotTarget (mon: TMonster): Boolean;
begin
result := false; // don't stop
- if mon.Live and tr_ShotAimCheck(Trigger, @(mon.Obj)) then
+ if mon.alive and tr_ShotAimCheck(Trigger, @(mon.Obj)) then
begin
xd := mon.GameX + mon.Obj.Rect.Width div 2;
yd := mon.GameY + mon.Obj.Rect.Height div 2;
function monsShotTargetMonPlr (mon: TMonster): Boolean;
begin
result := false; // don't stop
- if mon.Live and tr_ShotAimCheck(Trigger, @(mon.Obj)) then
+ if mon.alive and tr_ShotAimCheck(Trigger, @(mon.Obj)) then
begin
xd := mon.GameX + mon.Obj.Rect.Width div 2;
yd := mon.GameY + mon.Obj.Rect.Height div 2;
function monShotTargetPlrMon (mon: TMonster): Boolean;
begin
result := false; // don't stop
- if mon.Live and tr_ShotAimCheck(Trigger, @(mon.Obj)) then
+ if mon.alive and tr_ShotAimCheck(Trigger, @(mon.Obj)) then
begin
xd := mon.GameX + mon.Obj.Rect.Width div 2;
yd := mon.GameY + mon.Obj.Rect.Height div 2;
TRIGGER_SHOT_TARGET_PLR: // players
if gPlayers <> nil then
for idx := Low(gPlayers) to High(gPlayers) do
- if (gPlayers[idx] <> nil) and gPlayers[idx].Live and
+ if (gPlayers[idx] <> nil) and gPlayers[idx].alive and
tr_ShotAimCheck(Trigger, @(gPlayers[idx].Obj)) then
begin
xd := gPlayers[idx].GameX + PLAYER_RECT_CX;
TRIGGER_SHOT_TARGET_RED: // red team
if gPlayers <> nil then
for idx := Low(gPlayers) to High(gPlayers) do
- if (gPlayers[idx] <> nil) and gPlayers[idx].Live and
+ if (gPlayers[idx] <> nil) and gPlayers[idx].alive and
(gPlayers[idx].Team = TEAM_RED) and
tr_ShotAimCheck(Trigger, @(gPlayers[idx].Obj)) then
begin
TRIGGER_SHOT_TARGET_BLUE: // blue team
if gPlayers <> nil then
for idx := Low(gPlayers) to High(gPlayers) do
- if (gPlayers[idx] <> nil) and gPlayers[idx].Live and
+ if (gPlayers[idx] <> nil) and gPlayers[idx].alive and
(gPlayers[idx].Team = TEAM_BLUE) and
tr_ShotAimCheck(Trigger, @(gPlayers[idx].Obj)) then
begin
if (TargetUID = 0) and (gPlayers <> nil) then
for idx := Low(gPlayers) to High(gPlayers) do
- if (gPlayers[idx] <> nil) and gPlayers[idx].Live and
+ if (gPlayers[idx] <> nil) and gPlayers[idx].alive and
tr_ShotAimCheck(Trigger, @(gPlayers[idx].Obj)) then
begin
xd := gPlayers[idx].GameX + PLAYER_RECT_CX;
begin
if gPlayers <> nil then
for idx := Low(gPlayers) to High(gPlayers) do
- if (gPlayers[idx] <> nil) and gPlayers[idx].Live and
+ if (gPlayers[idx] <> nil) and gPlayers[idx].alive and
tr_ShotAimCheck(Trigger, @(gPlayers[idx].Obj)) then
begin
xd := gPlayers[idx].GameX + PLAYER_RECT_CX;
if gPlayers[b] <> nil then
with gPlayers[b] do
// Æèâ, åñòü íóæíûå êëþ÷è è îí ðÿäîì:
- if Live and ((gTriggers[a].Keys and GetKeys) = gTriggers[a].Keys) and
+ if alive and ((gTriggers[a].Keys and GetKeys) = gTriggers[a].Keys) and
Collide(X, Y, Width, Height) then
begin
gTriggers[a].ActivateUID := UID;
diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index 5d6a7848adf18b7b061505e667026823c8f13098..034642c34561165f8398d2d11153c2764cd5c071 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
function monsWaterCheck (mon: TMonster): Boolean;
begin
result := false; // don't stop
- if mon.Live and mon.Collide(gWater[WaterMap[a][c]]) and (not InWArray(monidx, chkTrap_mn)) and (i2 < 1023) then //FIXME
+ if mon.alive and mon.Collide(gWater[WaterMap[a][c]]) and (not InWArray(monidx, chkTrap_mn)) and (i2 < 1023) then //FIXME
begin
i2 += 1;
chkTrap_mn[i2] := monidx;
pan := gWater[WaterMap[a][c]];
for d := 0 to High(gPlayers) do
begin
- if (gPlayers[d] <> nil) and (gPlayers[d].Live) then
+ if (gPlayers[d] <> nil) and (gPlayers[d].alive) then
begin
if gPlayers[d].Collide(pan) then
begin
function monsCheck (mon: TMonster): Boolean;
begin
result := false; // don't stop
- if (mon.Live) and (mon.UID <> SpawnerUID) then
+ if (mon.alive) and (mon.UID <> SpawnerUID) then
begin
with mon do
begin
if h <> -1 then
for i := 0 to h do
- if (gPlayers[i] <> nil) and (gPlayers[i].Live) and (gPlayers[i].UID <> SpawnerUID) then
+ if (gPlayers[i] <> nil) and (gPlayers[i].alive) and (gPlayers[i].UID <> SpawnerUID) then
with gPlayers[i] do
if (g_PatchLength(X, Y, GameX+PLAYER_RECT.X+(PLAYER_RECT.Width div 2),
GameY+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2)) <= SHOT_BFG_RADIUS) and
if h <> -1 then
for i := 0 to h do
- if (gPlayers[i] <> nil) and gPlayers[i].Live and g_Obj_Collide(obj, @gPlayers[i].Obj) then
+ if (gPlayers[i] <> nil) and gPlayers[i].alive and g_Obj_Collide(obj, @gPlayers[i].Obj) then
begin
ChkTeam := True;
if (Team > 0) and (g_GetUIDType(SpawnerUID) = UID_PLAYER) then
function monsCheckHit (monidx: Integer; mon: TMonster): Boolean;
begin
result := false; // don't stop
- if mon.Live and g_Obj_Collide(obj, @mon.Obj) then
+ if mon.alive and g_Obj_Collide(obj, @mon.Obj) then
begin
if HitMonster(mon, d, obj^.Vel.X, obj^.Vel.Y, SpawnerUID, t) then
begin
mm := Max(abs(dx), abs(dy));
if mm = 0 then mm := 1;
- if mon.Live then
+ if mon.alive then
begin
HitMonster(mon, ((mon.Obj.Rect.Width div 4)*10*(rad-mm)) div rad, 0, 0, SpawnerUID, HIT_ROCKET);
end;
if h <> -1 then
for i := 0 to h do
- if (gPlayers[i] <> nil) and gPlayers[i].Live then
+ if (gPlayers[i] <> nil) and gPlayers[i].alive then
with gPlayers[i] do
begin
dx := Obj.X+Obj.Rect.X+(Obj.Rect.Width div 2)-X;
if gAdvGibs and (h <> -1) then
for i := 0 to h do
- if gGibs[i].Live then
+ if gGibs[i].alive then
with gGibs[i] do
begin
dx := Obj.X+Obj.Rect.X+(Obj.Rect.Width div 2)-X;
result := false;
for i := 0 to High(gPlayers) do
begin
- if (gPlayers[i] <> nil) and gPlayers[i].Live and gPlayers[i].Collide(X, Y) then
+ if (gPlayers[i] <> nil) and gPlayers[i].alive and gPlayers[i].Collide(X, Y) then
begin
if HitPlayer(gPlayers[i], dmg, vx*10, vy*10-3, SpawnerUID, HIT_SOME) then
begin
begin
result := false;
if (idx < 0) or (idx > High(gPlayers)) then exit;
- if (gPlayers[idx] = nil) or not gPlayers[idx].Live then exit;
+ if (gPlayers[idx] = nil) or not gPlayers[idx].alive then exit;
result := HitPlayer(gPlayers[idx], dmg, (xi*v)*10, (yi*v)*10-3, SpawnerUID, HIT_SOME);
if result and (v <> 0) then gPlayers[idx].Push((xi*v), (yi*v));
{$IF DEFINED(D2F_DEBUG)}
for i := 0 to High(gPlayers) do
begin
plr := gPlayers[i];
- if (plr <> nil) and plr.Live then
+ if (plr <> nil) and plr.alive then
begin
plr.getMapBox(px, py, pw, ph);
if lineAABBIntersects(x, y, x2, y2, px, py, pw, ph, inx, iny) then