From: Jaka K. <lyn...@us...> - 2012-03-09 18:39:07
|
gemrb: Infinity Engine emulator The branch master has been updated via 895a1058b09bb0fdc8a4cb2ce753b0b38486df88 (commit) via 340bd66ae9b508047444915f49b2e0729b79abff (commit) Summary of changes: gemrb/GUIScripts/bg1/GUIOPT.py | 12 ++++++------ gemrb/GUIScripts/bg2/GUIOPT.py | 12 ++++++------ gemrb/GUIScripts/iwd/GUIOPT.py | 12 ++++++------ gemrb/GUIScripts/iwd2/GUIOPT.py | 12 ++++++------ gemrb/core/Scriptable/Actor.cpp | 14 +++++++++----- gemrb/core/Scriptable/Actor.h | 6 ++++-- 6 files changed, 37 insertions(+), 31 deletions(-) from de556b6a2b698050370d2f34f95cd0349502fbf9 (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=895a1058b09bb0fdc8a4cb2ce753b0b38486df88 commit 895a1058b09bb0fdc8a4cb2ce753b0b38486df88 Author: Evan Shaw <ed...@gm...> Date: Fri Mar 9 13:12:15 2012 +1300 Fix segfault for games with no monk class When an unarmed character attacked, the engine tried to apply monk bonuses even when no monk class was available, causing a segfault. diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index 23c4084..da01171 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -5072,7 +5072,7 @@ ieDword Actor::GetNumberOfAttacks() const { int bonus = 0; - if (Equipped == IW_NO_EQUIPPED) { + if (monkbon != NULL && Equipped == IW_NO_EQUIPPED) { unsigned int level = GetMonkLevel(); if (level>=monkbon_cols) level=monkbon_cols-1; if (level>0) { http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=340bd66ae9b508047444915f49b2e0729b79abff commit 340bd66ae9b508047444915f49b2e0729b79abff Author: Evan Shaw <ed...@gm...> Date: Fri Mar 9 10:45:57 2012 +1300 Fix select and command sound issues * Correct the radio button values for CommandSounds and SelectionSounds in all games. * When Selection Sounds Frequency is Seldom, play sound 20% of the time instead of 25% of the time to match the option description. * When Command Sounds Frequency is Seldom, play a sound only once after the character has been selected. diff --git a/gemrb/GUIScripts/bg1/GUIOPT.py b/gemrb/GUIScripts/bg1/GUIOPT.py index 98ac733..cd46db0 100644 --- a/gemrb/GUIScripts/bg1/GUIOPT.py +++ b/gemrb/GUIScripts/bg1/GUIOPT.py @@ -296,12 +296,12 @@ def OpenCharacterSoundsWindow (): OptCheckbox ('Subtitles', Window, 5, 20, 'Subtitles', 1) OptCheckbox ('AttackSounds', Window, 6, 18, 'Attack Sounds', 1) OptCheckbox ('Footsteps', Window, 7, 19, 'Footsteps', 1) - OptRadio ('CommandSounds', Window, 8, 21, 'Command Sounds Frequency', 1) - OptRadio ('CommandSounds', Window, 9, 21, 'Command Sounds Frequency', 2) - OptRadio ('CommandSounds', Window, 10, 21, 'Command Sounds Frequency', 3) - OptRadio ('SelectionSounds', Window, 58, 57, 'Selection Sounds Frequency', 1) - OptRadio ('SelectionSounds', Window, 59, 57, 'Selection Sounds Frequency', 2) - OptRadio ('SelectionSounds', Window, 60, 57, 'Selection Sounds Frequency', 3) + OptRadio ('CommandSounds', Window, 8, 21, 'Command Sounds Frequency', 2) + OptRadio ('CommandSounds', Window, 9, 21, 'Command Sounds Frequency', 1) + OptRadio ('CommandSounds', Window, 10, 21, 'Command Sounds Frequency', 0) + OptRadio ('SelectionSounds', Window, 58, 57, 'Selection Sounds Frequency', 2) + OptRadio ('SelectionSounds', Window, 59, 57, 'Selection Sounds Frequency', 1) + OptRadio ('SelectionSounds', Window, 60, 57, 'Selection Sounds Frequency', 0) Window.ShowModal (MODAL_SHADOW_GRAY) diff --git a/gemrb/GUIScripts/bg2/GUIOPT.py b/gemrb/GUIScripts/bg2/GUIOPT.py index 444925d..40239a4 100644 --- a/gemrb/GUIScripts/bg2/GUIOPT.py +++ b/gemrb/GUIScripts/bg2/GUIOPT.py @@ -292,12 +292,12 @@ def OpenCharacterSoundsWindow (): OptCheckbox ('Subtitles', Window, 5, 20, 'Subtitles', 1) OptCheckbox ('AttackSounds', Window, 6, 18, 'Attack Sounds', 1) OptCheckbox ('Footsteps', Window, 7, 19, 'Footsteps', 1) - OptRadio ('CommandSounds', Window, 8, 21, 'Command Sounds Frequency', 1) - OptRadio ('CommandSounds', Window, 9, 21, 'Command Sounds Frequency', 2) - OptRadio ('CommandSounds', Window, 10, 21, 'Command Sounds Frequency', 3) - OptRadio ('SelectionSounds', Window, 58, 57, 'Selection Sounds Frequency', 1) - OptRadio ('SelectionSounds', Window, 59, 57, 'Selection Sounds Frequency', 2) - OptRadio ('SelectionSounds', Window, 60, 57, 'Selection Sounds Frequency', 3) + OptRadio ('CommandSounds', Window, 8, 21, 'Command Sounds Frequency', 2) + OptRadio ('CommandSounds', Window, 9, 21, 'Command Sounds Frequency', 1) + OptRadio ('CommandSounds', Window, 10, 21, 'Command Sounds Frequency', 0) + OptRadio ('SelectionSounds', Window, 58, 57, 'Selection Sounds Frequency', 2) + OptRadio ('SelectionSounds', Window, 59, 57, 'Selection Sounds Frequency', 1) + OptRadio ('SelectionSounds', Window, 60, 57, 'Selection Sounds Frequency', 0) Window.ShowModal (MODAL_SHADOW_GRAY) diff --git a/gemrb/GUIScripts/iwd/GUIOPT.py b/gemrb/GUIScripts/iwd/GUIOPT.py index ee8e21b..5946b14 100644 --- a/gemrb/GUIScripts/iwd/GUIOPT.py +++ b/gemrb/GUIScripts/iwd/GUIOPT.py @@ -496,12 +496,12 @@ def OpenCharacterSoundsWindow (): OptCheckbox ('Subtitles', Window, 5, 20, 'Subtitles', 1) OptCheckbox ('AttackSounds', Window, 6, 18, 'Attack Sounds', 1) OptCheckbox ('Footsteps', Window, 7, 19, 'Footsteps', 1) - OptRadio ('CommandSounds', Window, 8, 21, 'Command Sounds Frequency', 1) - OptRadio ('CommandSounds', Window, 9, 21, 'Command Sounds Frequency', 2) - OptRadio ('CommandSounds', Window, 10, 21, 'Command Sounds Frequency', 3) - OptRadio ('SelectionSounds', Window, 58, 57, 'Selection Sounds Frequency', 1) - OptRadio ('SelectionSounds', Window, 59, 57, 'Selection Sounds Frequency', 2) - OptRadio ('SelectionSounds', Window, 60, 57, 'Selection Sounds Frequency', 3) + OptRadio ('CommandSounds', Window, 8, 21, 'Command Sounds Frequency', 2) + OptRadio ('CommandSounds', Window, 9, 21, 'Command Sounds Frequency', 1) + OptRadio ('CommandSounds', Window, 10, 21, 'Command Sounds Frequency', 0) + OptRadio ('SelectionSounds', Window, 58, 57, 'Selection Sounds Frequency', 2) + OptRadio ('SelectionSounds', Window, 59, 57, 'Selection Sounds Frequency', 1) + OptRadio ('SelectionSounds', Window, 60, 57, 'Selection Sounds Frequency', 0) Window.ShowModal (MODAL_SHADOW_GRAY) def DisplayHelpSubtitles (): diff --git a/gemrb/GUIScripts/iwd2/GUIOPT.py b/gemrb/GUIScripts/iwd2/GUIOPT.py index 45f8f9c..b400afe 100644 --- a/gemrb/GUIScripts/iwd2/GUIOPT.py +++ b/gemrb/GUIScripts/iwd2/GUIOPT.py @@ -494,12 +494,12 @@ def OpenCharacterSoundsWindow (): OptCheckbox ('Subtitles', Window, 5, 20, 'Subtitles', 1) OptCheckbox ('AttackSounds', Window, 6, 18, 'Attack Sounds', 1) OptCheckbox ('Footsteps', Window, 7, 19, 'Footsteps', 1) - OptRadio ('CommandSounds', Window, 8, 21, 'Command Sounds Frequency', 1) - OptRadio ('CommandSounds', Window, 9, 21, 'Command Sounds Frequency', 2) - OptRadio ('CommandSounds', Window, 10, 21, 'Command Sounds Frequency', 3) - OptRadio ('SelectionSounds', Window, 58, 57, 'Selection Sounds Frequency', 1) - OptRadio ('SelectionSounds', Window, 59, 57, 'Selection Sounds Frequency', 2) - OptRadio ('SelectionSounds', Window, 60, 57, 'Selection Sounds Frequency', 3) + OptRadio ('CommandSounds', Window, 8, 21, 'Command Sounds Frequency', 2) + OptRadio ('CommandSounds', Window, 9, 21, 'Command Sounds Frequency', 1) + OptRadio ('CommandSounds', Window, 10, 21, 'Command Sounds Frequency', 0) + OptRadio ('SelectionSounds', Window, 58, 57, 'Selection Sounds Frequency', 2) + OptRadio ('SelectionSounds', Window, 59, 57, 'Selection Sounds Frequency', 1) + OptRadio ('SelectionSounds', Window, 60, 57, 'Selection Sounds Frequency', 0) Window.ShowModal (MODAL_SHADOW_GRAY) diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index d5ee3df..23c4084 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -382,6 +382,8 @@ Actor::Actor() LongStrRef = (ieStrRef) -1; ShortStrRef = (ieStrRef) -1; + playedCommandSound = false; + PCStats = NULL; LastDamage = 0; LastDamageType = 0; @@ -3109,13 +3111,14 @@ bool Actor::GetPartyComment() } //call this only from gui selects -void Actor::SelectActor() const +void Actor::SelectActor() { + playedCommandSound = false; switch (sel_snd_freq) { case 0: return; case 1: - if (core->Roll(1,100,0) > 25) return; + if (core->Roll(1,100,0) > 20) return; default:; } @@ -3137,13 +3140,14 @@ void Actor::SelectActor() const #define SEL_ACTION_COUNT_ALL 7 //call this when a PC receives a command from GUI -void Actor::CommandActor() const +void Actor::CommandActor() { switch (cmd_snd_freq) { case 0: return; case 1: - if (core->Roll(1,100,0)>25) return; + if (playedCommandSound) return; + playedCommandSound = true; case 2: //PST has 4 states and rare sounds if (raresnd) { diff --git a/gemrb/core/Scriptable/Actor.h b/gemrb/core/Scriptable/Actor.h index a3014ce..648fcde 100644 --- a/gemrb/core/Scriptable/Actor.h +++ b/gemrb/core/Scriptable/Actor.h @@ -337,6 +337,8 @@ private: CharAnimations* anims; SpriteCover* extraCovers[EXTRA_ACTORCOVERS]; ieByte SavingThrow[5]; + // true when command has been played after select + bool playedCommandSound; //true every second round of attack bool secondround; int attacksperround; @@ -485,9 +487,9 @@ public: /* receives undead turning message */ void Turn(Scriptable *cleric, ieDword turnlevel); /* call this on gui selects */ - void SelectActor() const; + void SelectActor(); /* call this when adding actions via gui */ - void CommandActor() const; + void CommandActor(); /** handle panic and other involuntary actions that mess with scripting */ bool OverrideActions(); /** handle idle actions, that shouldn't mess with scripting */ ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |