From: Ketmar Dark Date: Sun, 3 Sep 2017 16:13:09 +0000 (+0300) Subject: field namefix: `FLive` -> `FAlive`; `live` -> `alive` X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=a7daeef3855f07c8302a60ab31cb20ab74aefc45;p=d2df-sdl.git field namefix: `FLive` -> `FAlive`; `live` -> `alive` --- diff --git a/src/engine/e_graphics.pas b/src/engine/e_graphics.pas index b7ddd2c..b88dfb6 100644 --- a/src/engine/e_graphics.pas +++ b/src/engine/e_graphics.pas @@ -167,7 +167,7 @@ type end; Space: ShortInt; Height: ShortInt; - Live: Boolean; + alive: Boolean; end; TSavedTexture = record @@ -1051,7 +1051,7 @@ begin 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; @@ -1073,7 +1073,7 @@ begin end; Space := sp; - Live := True; + alive := True; end; Result := id; @@ -1345,7 +1345,7 @@ begin 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 8069029..530bf8e 100644 --- a/src/game/g_basic.pas +++ b/src/game/g_basic.pas @@ -138,7 +138,7 @@ begin 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; @@ -959,7 +959,7 @@ begin 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; @@ -968,7 +968,7 @@ begin 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 9ec9639..a377122 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -2495,7 +2495,7 @@ var result := false; // don't stop with mon do begin - if Live then + if alive then begin // Ëåâûé âåðõíèé óãîë aX := Obj.X div ScaleSz + 1; @@ -2658,7 +2658,7 @@ begin // Ðèñóåì èãðîêîâ: 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; @@ -5100,7 +5100,7 @@ begin 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 8bdbf88..bd8d9ae 100644 --- a/src/game/g_gfx.pas +++ b/src/game/g_gfx.pas @@ -363,6 +363,7 @@ procedure TParticle.think (); inline; state := TPartState.Normal; floorY := Unknown; ceilingY := Unknown; + wallEndY := Unknown; if (velY = 0) then velY := 0.1; if (accelY = 0) then accelY := 0.5; end; @@ -425,7 +426,13 @@ procedure TParticle.thinkerBloodAndWater (); 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 @@ -439,7 +446,7 @@ procedure TParticle.thinkerBloodAndWater (); procedure applyGravity (inLiquid: Boolean); begin state := TPartState.Normal; - if (inLiquid) then + if inLiquid then begin velY := 0.5; accelY := 0.15; @@ -452,12 +459,13 @@ procedure TParticle.thinkerBloodAndWater (); 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; @@ -491,7 +499,14 @@ begin 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 @@ -499,8 +514,15 @@ 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 @@ -540,14 +562,23 @@ 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 @@ -620,7 +651,8 @@ 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]); @@ -633,6 +665,15 @@ begin 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 @@ -1472,6 +1513,7 @@ end; procedure g_GFX_Draw (); var a, len: Integer; + scaled: Boolean; begin if not gpart_dbg_enabled then exit; @@ -1485,12 +1527,15 @@ begin 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 a534e7a..42f52c5 100644 --- a/src/game/g_holmes.pas +++ b/src/game/g_holmes.pas @@ -114,7 +114,7 @@ var 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 e07944a..c756541 100644 --- a/src/game/g_items.pas +++ b/src/game/g_items.pas @@ -34,7 +34,7 @@ Type Respawnable: Boolean; InitX, InitY: Integer; RespawnTime: Word; - Live: Boolean; + alive: Boolean; Fall: Boolean; QuietRespawn: Boolean; SpawnTrigger: Integer; @@ -342,7 +342,7 @@ begin it.Animation.Free(); it.Animation := nil; end; - it.Live := False; + it.alive := False; it.SpawnTrigger := -1; it.ItemType := ITEM_NONE; freeIds.release(LongWord(idx)); @@ -365,7 +365,7 @@ begin 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'); @@ -456,7 +456,7 @@ begin it.InitY := Y; it.RespawnTime := 0; it.Fall := Fall; - it.Live := True; + it.alive := True; it.QuietRespawn := False; g_Obj_Init(@it.Obj); @@ -516,7 +516,7 @@ begin begin nxt := False; - if Live then + if alive then begin if Fall then begin @@ -552,7 +552,7 @@ 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; @@ -586,7 +586,7 @@ begin 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); @@ -605,7 +605,7 @@ begin 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; @@ -626,7 +626,7 @@ begin 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 @@ -657,7 +657,7 @@ end; procedure g_Items_Pick (ID: DWORD); begin - ggItems[ID].Live := false; + ggItems[ID].alive := false; ggItems[ID].RespawnTime := ITEM_RESPAWNTIME; end; @@ -716,7 +716,7 @@ begin // Âðåìÿ äî ðåñïàóíà Mem.WriteWord(ggItems[i].RespawnTime); // Ñóùåñòâóåò ëè ýòîò ïðåäìåò - Mem.WriteBoolean(ggItems[i].Live); + Mem.WriteBoolean(ggItems[i].alive); // Ìîæåò ëè îí ïàäàòü Mem.WriteBoolean(ggItems[i].Fall); // Èíäåêñ òðèããåðà, ñîçäàâøåãî ïðåäìåò @@ -760,7 +760,7 @@ begin // Âðåìÿ äî ðåñïàóíà Mem.ReadWord(ggItems[i].RespawnTime); // Ñóùåñòâóåò ëè ýòîò ïðåäìåò - Mem.ReadBoolean(ggItems[i].Live); + Mem.ReadBoolean(ggItems[i].alive); // Ìîæåò ëè îí ïàäàòü Mem.ReadBoolean(ggItems[i].Fall); // Èíäåêñ òðèããåðà, ñîçäàâøåãî ïðåäìåò @@ -804,7 +804,7 @@ begin 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; @@ -815,7 +815,7 @@ begin 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; @@ -890,7 +890,7 @@ begin 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 4b197e3..50b0d26 100644 --- a/src/game/g_map.pas +++ b/src/game/g_map.pas @@ -2487,7 +2487,7 @@ begin 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 93666fa..a842519 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -1327,8 +1327,8 @@ var 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; // Çàïðåòèòü ñîõðàíåíèå â èíòåðìèññèè (íå ðåàëèçîâàíî) diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index a437ff9..5719ca4 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -105,7 +105,7 @@ type 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; @@ -2002,7 +2002,7 @@ begin Result := False; if g_Game_IsClient then Exit; - if not Live then + if not alive then Exit; if FHealth < FMaxHealth then @@ -2329,7 +2329,7 @@ begin (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 @@ -2492,7 +2492,7 @@ begin // Åñëè åñòü èãðîê ðÿäîì, ïðîñûïàåìñÿ è èäåì ê íåìó: 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 @@ -2510,7 +2510,7 @@ begin // Åñëè åñòü ïîäõîäÿùèé ìîíñòð ðÿäîì: 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 // Ìàíüÿêè íàïàäàþò íà âñåõ ìîíñòðîâ, êðîìå äðóçåé @@ -2712,7 +2712,7 @@ 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 @@ -3544,7 +3544,7 @@ 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 @@ -3996,7 +3996,7 @@ 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 @@ -4016,7 +4016,7 @@ begin // Êèëëåðû è äîáðûå íå òðîãàþò ìîíñòðîâ 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 @@ -4269,7 +4269,7 @@ begin Result := True; end; -function TMonster.Live(): Boolean; +function TMonster.alive(): Boolean; begin Result := (FState <> MONSTATE_DIE) and (FState <> MONSTATE_DEAD) and (FHealth > 0); end; @@ -4577,7 +4577,7 @@ 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 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 @@ -4608,7 +4608,7 @@ 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 @@ -4643,7 +4643,7 @@ 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 @@ -4687,7 +4687,7 @@ 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 diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index 33d1652..21046a0 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -1073,7 +1073,7 @@ begin with P do begin - NetOut.Write(Byte(Live)); + NetOut.Write(Byte(alive)); NetOut.Write(Byte(GodMode)); NetOut.Write(Health); NetOut.Write(Armor); @@ -2140,7 +2140,7 @@ begin with Pl do begin - Live := (M.ReadByte() <> 0); + alive := (M.ReadByte() <> 0); GodMode := (M.ReadByte() <> 0); Health := M.ReadLongInt(); Armor := M.ReadLongInt(); @@ -2306,7 +2306,7 @@ begin 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 809f781..0a3f8f7 100644 --- a/src/game/g_panel.pas +++ b/src/game/g_panel.pas @@ -571,7 +571,8 @@ var 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 @@ -582,7 +583,7 @@ var 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 @@ -644,7 +645,7 @@ begin 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 a16abee..41fdfdd 100644 --- a/src/game/g_phys.pas +++ b/src/game/g_phys.pas @@ -138,7 +138,7 @@ begin 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 04719fc..1c01e2f 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -139,7 +139,7 @@ type FUID: Word; FName: String; FTeam: Byte; - FLive: Boolean; + FAlive: Boolean; FSpawned: Boolean; FDirection: TDirection; FHealth: Integer; @@ -343,7 +343,7 @@ type 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; @@ -414,7 +414,7 @@ type end; TGib = record - Live: Boolean; + alive: Boolean; ID: DWORD; MaskID: DWORD; RAngle: Integer; @@ -427,7 +427,7 @@ type TShell = record SpriteID: DWORD; - Live: Boolean; + alive: Boolean; SType: Byte; RAngle: Integer; Timeout: Cardinal; @@ -748,7 +748,7 @@ begin 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; @@ -809,7 +809,7 @@ begin 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); // Íàïðàâëåíèå: @@ -1443,7 +1443,7 @@ var 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; @@ -1477,7 +1477,7 @@ var find_id: DWORD; ok: Boolean; begin - if Player.Live then + if Player.alive then Exit; if Player.FObj.Y >= gMapInfo.Height+128 then Exit; @@ -1544,7 +1544,7 @@ begin 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)); @@ -1575,7 +1575,7 @@ begin 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); @@ -1616,7 +1616,7 @@ 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 vel := Obj.Vel; @@ -1625,7 +1625,7 @@ begin if WordBool(mr and MOVE_FALLOUT) then begin - Live := False; + alive := False; Continue; end; @@ -1666,7 +1666,7 @@ 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 vel := Obj.Vel; @@ -1675,7 +1675,7 @@ begin if WordBool(mr and MOVE_FALLOUT) or (gShells[i].Timeout < gTime) then begin - Live := False; + alive := False; Continue; end; @@ -1719,7 +1719,7 @@ var 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 @@ -1750,7 +1750,7 @@ var 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 @@ -1920,7 +1920,7 @@ begin 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 @@ -1963,12 +1963,12 @@ var 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; @@ -2123,7 +2123,7 @@ begin end; // Áóôåð óðîíà: - if FLive then + if FAlive then Inc(FDamageBuffer, value); // Âñïûøêà áîëè: @@ -2144,7 +2144,7 @@ begin 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 @@ -2267,7 +2267,7 @@ var 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 @@ -2314,7 +2314,7 @@ begin 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; @@ -3055,13 +3055,13 @@ begin 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; @@ -4001,7 +4001,7 @@ end; 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 @@ -4025,7 +4025,7 @@ end; procedure TPlayer.Reset(Force: Boolean); begin if Force then - FLive := False; + FAlive := False; FSpawned := False; FTime[T_RESPAWN] := 0; @@ -4235,7 +4235,7 @@ begin if Force then begin FTime[T_RESPAWN] := 0; - FLive := False; + FAlive := False; end; FNetTime := 0; // if server changes MaxLives we gotta be ready @@ -4271,11 +4271,11 @@ begin 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; @@ -4381,7 +4381,7 @@ end; 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 @@ -4391,7 +4391,7 @@ begin FXTo := GameX; FYTo := GameY; - FLive := False; + FAlive := False; FSpectator := True; FGhost := True; FPhysics := False; @@ -4418,7 +4418,7 @@ end; procedure TPlayer.SwitchNoClip; begin - if not FLive then + if not FAlive then Exit; FGhost := not FGhost; FPhysics := not FGhost; @@ -4457,7 +4457,7 @@ 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 @@ -4569,7 +4569,7 @@ 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; @@ -4659,7 +4659,7 @@ begin FLoss := 0; end; - if FLive and (gFly or FJetpack) then + if FAlive and (gFly or FJetpack) then FlySmoke(); if FDirection = D_LEFT then @@ -4667,7 +4667,7 @@ begin else FAngle := 0; - if FLive and (not FGhost) then + if FAlive and (not FGhost) then begin if FKeys[KEY_UP].Pressed then SeeUp(); @@ -4685,12 +4685,12 @@ begin 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); @@ -4709,7 +4709,7 @@ begin FActionChanged := False; - if FLive then + if FAlive then begin // Let alive player do some actions if FKeys[KEY_LEFT].Pressed then Run(D_LEFT); @@ -4748,7 +4748,7 @@ begin 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) @@ -4774,7 +4774,7 @@ begin 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; @@ -4836,7 +4836,7 @@ begin 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; @@ -4849,7 +4849,7 @@ begin 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); @@ -4857,7 +4857,7 @@ begin 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; @@ -4868,7 +4868,7 @@ begin i := 9; - if FLive then + if FAlive then begin if FCurrWeap = WEAPON_SAW then if not (FSawSound.IsPlaying() or FSawSoundHit.IsPlaying() or @@ -5012,7 +5012,7 @@ begin 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) @@ -5024,7 +5024,7 @@ begin end; {CollideItem();} - end; // if FLive then ... + end; // if FAlive then ... if (FActionAnim = A_PAIN) and (FModel.Animation <> A_PAIN) then begin @@ -5130,7 +5130,7 @@ 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 @@ -5574,7 +5574,7 @@ begin // Êîìàíäà: Mem.WriteByte(FTeam); // Æèâ ëè: - Mem.WriteBoolean(FLive); + Mem.WriteBoolean(FAlive); // Èçðàñõîäîâàë ëè âñå æèçíè: Mem.WriteBoolean(FNoRespawn); // Íàïðàâëåíèå: @@ -5714,7 +5714,7 @@ begin // Êîìàíäà: Mem.ReadByte(FTeam); // Æèâ ëè: - Mem.ReadBoolean(FLive); + Mem.ReadBoolean(FAlive); // Èçðàñõîäîâàë ëè âñå æèçíè: Mem.ReadBoolean(FNoRespawn); // Íàïðàâëåíèå: @@ -6359,7 +6359,7 @@ var 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; @@ -6482,7 +6482,7 @@ begin // Èãðîêè: 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 @@ -6672,14 +6672,14 @@ begin 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; @@ -6821,7 +6821,7 @@ procedure TBot.Update(); var EnableAI: Boolean; begin - if not FLive then + if not FAlive then begin // Respawn ReleaseKeys(); PressKey(KEY_UP); diff --git a/src/game/g_triggers.pas b/src/game/g_triggers.pas index 1c8a586..2da3a1e 100644 --- a/src/game/g_triggers.pas +++ b/src/game/g_triggers.pas @@ -273,7 +273,7 @@ begin 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; @@ -334,7 +334,7 @@ begin 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; @@ -346,7 +346,7 @@ begin (* 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); *) @@ -1033,7 +1033,7 @@ var 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; @@ -1045,7 +1045,7 @@ var 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; @@ -1057,7 +1057,7 @@ var 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; @@ -1970,7 +1970,7 @@ begin 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; @@ -1982,7 +1982,7 @@ begin 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 @@ -1995,7 +1995,7 @@ 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 @@ -2012,7 +2012,7 @@ 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; @@ -2026,7 +2026,7 @@ begin 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; @@ -2551,7 +2551,7 @@ begin 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 5d6a784..034642c 100644 --- a/src/game/g_weapons.pas +++ b/src/game/g_weapons.pas @@ -338,7 +338,7 @@ var 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; @@ -385,7 +385,7 @@ begin 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 @@ -499,7 +499,7 @@ procedure g_Weapon_BFG9000(X, Y: Integer; SpawnerUID: Word); 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 @@ -547,7 +547,7 @@ 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 @@ -802,7 +802,7 @@ var 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 @@ -829,7 +829,7 @@ var 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 @@ -982,7 +982,7 @@ var 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; @@ -1006,7 +1006,7 @@ begin 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; @@ -1060,7 +1060,7 @@ begin 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; @@ -1234,7 +1234,7 @@ begin 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 @@ -1393,7 +1393,7 @@ var 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)} @@ -1426,7 +1426,7 @@ var 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