Skip to content

Commit 351e8b8

Browse files
committed
dsda: fix ssg selection when sg is not owned
1 parent 1fc80df commit 351e8b8

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Assets/dll/dsda.wbx.zst

118 Bytes
Binary file not shown.

waterbox/dsda/BizhawkInterface.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,28 @@ void player_input(struct PackedPlayerInput *src, int id)
246246
if (newweapon==wp_fist
247247
&& player->weaponowned[wp_chainsaw]
248248
&& player->readyweapon!=wp_chainsaw
249-
&& (player->readyweapon==wp_fist || !player->powers[pw_strength] || P_WeaponPreferred(wp_chainsaw, wp_fist)))
249+
&& (
250+
player->readyweapon==wp_fist
251+
|| !player->powers[pw_strength]
252+
|| P_WeaponPreferred(wp_chainsaw, wp_fist)
253+
)
254+
)
250255
newweapon = wp_chainsaw;
256+
257+
// Select SSG from '3' only if it's owned and the player
258+
// does not have a shotgun, or if the shotgun is already
259+
// in use, or if the SSG is not already in use and the
260+
// player prefers it.
261+
if (newweapon == wp_shotgun
262+
&& gamemode == commercial
263+
&& player->weaponowned[wp_supershotgun]
264+
&& (
265+
!player->weaponowned[wp_shotgun]
266+
|| player->readyweapon == wp_shotgun
267+
|| (player->readyweapon != wp_supershotgun && P_WeaponPreferred(wp_supershotgun, wp_shotgun))
268+
)
269+
)
270+
newweapon = wp_supershotgun;
251271
}
252272

253273
dest->buttons |= (newweapon) << BT_WEAPONSHIFT;

0 commit comments

Comments
 (0)