From babdae682f094e8ea4e84bd5efffd14734587c7e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 1 Nov 2021 08:25:00 +0100 Subject: [PATCH] - input.cpp cleanup. --- source/games/sw/src/input.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/games/sw/src/input.cpp b/source/games/sw/src/input.cpp index 229b4831b..66c0df56a 100644 --- a/source/games/sw/src/input.cpp +++ b/source/games/sw/src/input.cpp @@ -80,8 +80,8 @@ enum static void processWeapon(PLAYERp const pp) { - if (pp->PlayerSprite < 0) return; - USERp u = User[pp->PlayerSprite].Data(); + if (pp->Actor() == nullptr) return; + USERp u = pp->Actor()->u(); int i; if (loc.getNewWeapon() == WeaponSel_Next) @@ -121,7 +121,6 @@ static void processWeapon(PLAYERp const pp) } else if (loc.getNewWeapon() == WeaponSel_Prev) { - USERp u = User[pp->PlayerSprite].Data(); short prev_weapon = u->WeaponNum - 1; short start_weapon; @@ -154,7 +153,6 @@ static void processWeapon(PLAYERp const pp) } else if (loc.getNewWeapon() == WeaponSel_Alt) { - USERp u = User[pp->PlayerSprite].Data(); short const which_weapon = u->WeaponNum + 1; loc.setNewWeapon(which_weapon); }