From 0e33206e478e717ed7f40669bbb608e997e793a0 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Tue, 18 May 2021 20:01:56 -0600 Subject: [PATCH] Include check for negative index in setting party leader --- src/engine/game/party.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/engine/game/party.cpp b/src/engine/game/party.cpp index 99ca250c..ca9d7cfe 100644 --- a/src/engine/game/party.cpp +++ b/src/engine/game/party.cpp @@ -187,14 +187,7 @@ void Party::setPartyLeader(int npc) { } void Party::setPartyLeaderByIndex(int index) { - if (index == 0) { - warn("Party: attempted to switch leader to current party member: " + to_string(index)); - return; - } - if (index >= _members.size()) { - warn("Party: index out of range: " + to_string(index)); - return; - } + if (index < 1 || index >= _members.size()) return; Member tmp(_members[0]); _members[0] = _members[index];