summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b691e51)
raw | patch | inline | side by side (parent: b691e51)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Tue, 28 Feb 2023 17:26:46 +0000 (20:26 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Tue, 28 Feb 2023 17:26:46 +0000 (20:26 +0300) |
src/game/g_weapons.pas | patch | blob | history |
diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index c4fa747a2da29d779fd14e4ac3719a06b3c634f0..6e65496ee606b7b1a207c95905ee72042be409f2 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
g_Weapon_gun(x, y, xd, yd, 1, 3, SpawnerUID, True);
if gGameSettings.GameMode in [GM_DM, GM_TDM, GM_CTF] then
begin
- g_Weapon_gun(x, y+1, xd, yd+1, 1, 3, SpawnerUID, False);
- g_Weapon_gun(x, y-1, xd, yd-1, 1, 2, SpawnerUID, False);
+ if ABS(x-xd) >= ABS(y-yd) then
+ begin
+ g_Weapon_gun(x, y+1, xd, yd+1, 1, 3, SpawnerUID, False);
+ g_Weapon_gun(x, y-1, xd, yd-1, 1, 2, SpawnerUID, False);
+ end
+ else
+ begin
+ g_Weapon_gun(x+1, y, xd+1, yd, 1, 3, SpawnerUID, False);
+ g_Weapon_gun(x-1, y, xd-1, yd, 1, 2, SpawnerUID, False);
+ end;
end;
end;
if (gGameSettings.GameMode in [GM_DM, GM_TDM, GM_CTF]) and
(g_GetUIDType(SpawnerUID) = UID_PLAYER) then
begin
- g_Weapon_gun(x, y+1, xd, yd+1, 1, 2, SpawnerUID, False);
- g_Weapon_gun(x, y-1, xd, yd-1, 1, 2, SpawnerUID, False);
+ if ABS(x-xd) >= ABS(y-yd) then
+ begin
+ g_Weapon_gun(x, y+1, xd, yd+1, 1, 2, SpawnerUID, False);
+ g_Weapon_gun(x, y-1, xd, yd-1, 1, 2, SpawnerUID, False);
+ end
+ else
+ begin
+ g_Weapon_gun(x+1, y, xd+1, yd, 1, 2, SpawnerUID, False);
+ g_Weapon_gun(x-1, y, xd-1, yd, 1, 2, SpawnerUID, False);
+ end;
end;
end;
procedure g_Weapon_shotgun(x, y, xd, yd: Integer; SpawnerUID: Word;
Silent: Boolean = False);
var
- i, j: Integer;
+ i, j, k: Integer;
begin
if not Silent then
if gSoundEffectsDF then g_Sound_PlayExAt('SOUND_WEAPON_FIRESHOTGUN', x, y);
for i := 0 to 9 do
begin
- j := Random(17)-8; // -8 .. 8
- g_Weapon_gun(x, y+j, xd, yd+j, IfThen(i mod 2 <> 0, 1, 0), 3, SpawnerUID, i=0);
+ j := 0; k := 0;
+ if ABS(x-xd) >= ABS(y-yd) then j := Random(17) - 8 else k := Random(17) - 8; // -8 .. 8
+ g_Weapon_gun(x+k, y+j, xd+k, yd+j, IfThen(i mod 2 <> 0, 1, 0), 3, SpawnerUID, i=0);
end;
end;
procedure g_Weapon_dshotgun(x, y, xd, yd: Integer; SpawnerUID: Word;
Silent: Boolean = False);
var
- a, i, j: Integer;
+ a, i, j, k: Integer;
begin
if not Silent then
g_Sound_PlayExAt('SOUND_WEAPON_FIRESHOTGUN2', x, y);
if gGameSettings.GameMode in [GM_DM, GM_TDM, GM_CTF] then a := 25 else a := 20;
for i := 0 to a do
begin
- j := Random(41)-20; // -20 .. 20
- g_Weapon_gun(x, y+j, xd, yd+j, IfThen(i mod 3 <> 0, 0, 1), 3, SpawnerUID, i=0);
+ j := 0; k := 0;
+ if ABS(x-xd) >= ABS(y-yd) then j := Random(41) - 20 else k := Random(41) - 20; // -20 .. 20
+ g_Weapon_gun(x+k, y+j, xd+k, yd+j, IfThen(i mod 3 <> 0, 0, 1), 3, SpawnerUID, i=0);
end;
end;