From c14002f10a4a129b4051bd8a73388f74a7353cca Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 26 Feb 2017 00:00:02 +0000 Subject: [PATCH] Pass up return value of maybe_steal_primary_weapon --- d2x-rebirth/main/escort.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/d2x-rebirth/main/escort.cpp b/d2x-rebirth/main/escort.cpp index 2a020775c..cd7f80013 100644 --- a/d2x-rebirth/main/escort.cpp +++ b/d2x-rebirth/main/escort.cpp @@ -1507,8 +1507,8 @@ static int attempt_to_steal_item_3(const vobjptr_t objp, const vobjptr_t player_ // Makes it more likely to steal primary than secondary. for (int i=0; i<2; i++) - if (maybe_steal_primary_weapon(player_num, Primary_weapon)) - return 1; + if (auto r = maybe_steal_primary_weapon(player_num, Primary_weapon)) + return r; if (auto r = maybe_steal_secondary_weapon(player_num, player_num->ctype.player_info.Secondary_weapon)) return r; @@ -1533,8 +1533,8 @@ static int attempt_to_steal_item_3(const vobjptr_t objp, const vobjptr_t player_ return r; for (int i=MAX_SECONDARY_WEAPONS-1; i>=0; i--) { - if (maybe_steal_primary_weapon(player_num, i)) - return 1; + if (auto r = maybe_steal_primary_weapon(player_num, i)) + return r; if (auto r = maybe_steal_secondary_weapon(player_num, i)) return r; }