diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index 95137cdf456c88c61a4a800f93efae210b53e6b8..cf80f5914848fbb53451aaf3dc3cd1c90285dd14 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
SpawnerUID: Word;
Triggers: DWArray;
Obj: TObj;
- Animation: TAnimationState;
+ Animation: TAnimState;
Timeout: DWORD;
Stopped: Byte;
Obj.Rect.Width := SHOT_ROCKETLAUNCHER_WIDTH;
Obj.Rect.Height := SHOT_ROCKETLAUNCHER_HEIGHT;
- Animation := nil;
Triggers := nil;
ShotType := WEAPON_ROCKETLAUNCHER;
+ Animation.Invalidate;
end;
end;
Triggers := nil;
ShotType := WEAPON_PLASMA;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 5, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_BFG;
- Animation := TAnimationState.Create(True, 6, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 6, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_FLAMETHROWER;
- // Animation := TAnimationState.Create(True, 6, 0); // drawed as gfx
+ Animation.Invalidate;
+ // Animation := TAnimState.Create(True, 6, 0); // drawed as gfx
end;
end;
Triggers := nil;
ShotType := WEAPON_IMP_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_CACO_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_MANCUB_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_BARON_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_BSP_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_SKEL_FIRE;
target := TargetUID;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 5, 2); // !!! put values into table
end;
end;
end;
end;
procedure g_Weapon_Free();
-var
- i: Integer;
begin
- if Shots <> nil then
- begin
- for i := 0 to High(Shots) do
- if Shots[i].ShotType <> 0 then
- Shots[i].Animation.Free();
-
- Shots := nil;
- end;
-
+ Shots := nil;
WaterMap := nil;
end;
ShotType := WEAPON_ROCKETLAUNCHER;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 12);
- Animation := nil;
+ Animation.Invalidate;
triggers := nil;
end;
triggers := nil;
target := TargetUID;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 5, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 5, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := nil;
+ Animation.Invalidate;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 6, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 6, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
end;
// Àíèìàöèÿ ñíàðÿäà:
- if Animation <> nil then
+ if Animation.IsValid() then
Animation.Update();
// Äâèæåíèå:
begin
// Íà êëèåíòå ñêîðåå âñåãî è òàê óæå âûïàë.
ShotType := 0;
- Animation.Free();
+ Animation.Invalidate();
Continue;
end;
begin
if gGameSettings.GameType = GT_SERVER then
MH_SEND_DeleteShot(i, Obj.X, Obj.Y, Loud);
- if Animation <> nil then
- begin
- Animation.Free();
- Animation := nil;
- end;
+ Animation.Invalidate;
end
else if (ShotType <> WEAPON_FLAMETHROWER) and ((oldvx <> Obj.Vel.X) or (oldvy <> Obj.Vel.Y)) then
if gGameSettings.GameType = GT_SERVER then
Shots[i].Stopped := utils.readByte(st);
// Óñòàíîâêà òåêñòóðû èëè àíèìàöèè
- Shots[i].Animation := nil;
+ Shots[i].Animation.Invalidate;
case Shots[i].ShotType of
WEAPON_ROCKETLAUNCHER, WEAPON_SKEL_FIRE:
end;
WEAPON_PLASMA:
begin
- Shots[i].Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 5, 2); // !!! put values into table
end;
WEAPON_BFG:
begin
- Shots[i].Animation := TAnimationState.Create(True, 6, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 6, 2); // !!! put values into table
end;
WEAPON_IMP_FIRE:
begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
WEAPON_BSP_FIRE:
begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
WEAPON_CACO_FIRE:
begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
WEAPON_BARON_FIRE:
begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
WEAPON_MANCUB_FIRE:
begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
end;
end; // case ShotType of...
ShotType := 0;
- Animation.Free();
+ Animation.Invalidate;
end;
end;