From: Laszlo T. <ave...@us...> - 2012-03-18 09:46:31
|
gemrb: Infinity Engine emulator The branch master has been updated via 79fa839785eb0932c83343054487875306cb1b58 (commit) Summary of changes: gemrb/core/Inventory.cpp | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) from 0d7c21e0cc916c032c289137e32f33c9df1b7c33 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=79fa839785eb0932c83343054487875306cb1b58 commit 79fa839785eb0932c83343054487875306cb1b58 Author: Avenger <ave...@so...> Date: Sun Mar 18 10:45:48 2012 +0100 iwd2:fixed a combat crasher diff --git a/gemrb/core/Inventory.cpp b/gemrb/core/Inventory.cpp index cd0ea68..799404e 100644 --- a/gemrb/core/Inventory.cpp +++ b/gemrb/core/Inventory.cpp @@ -1232,9 +1232,14 @@ int Inventory::GetArmorSlot() int Inventory::GetShieldSlot() const { if (IWD2) { + //actually, in IWD2, the equipped slot never becomes IW_NO_EQUIPPED, it is always 0-3 + //this is just a hack to prevent invalid shots from happening + if (Equipped == IW_NO_EQUIPPED) return SLOT_MELEE+1; + if (Equipped>=0 && Equipped<=3) { return Equipped*2+SLOT_MELEE+1; } + //still, what about magic weapons... return -1; } return SLOT_LEFT; @@ -1246,8 +1251,8 @@ int Inventory::GetEquippedSlot() const return SLOT_FIST; } if (IWD2 && Equipped>=0) { - //i've absolutely NO idea what is this 4 (Avenger) - //Equipped should be 0-3 in iWD2, no??? + //Equipped should never become IW_NO_EQUIPPED, this is just a hack to cover the bug + //about it still becoming invalid if (Equipped >= 4) { return SLOT_MELEE; } ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |