mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 23:45:31 +00:00
Unset selected spell when removed
This commit is contained in:
parent
6ce499f0e6
commit
70d35da116
1 changed files with 9 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/dialoguemanager.hpp"
|
||||
#include "../mwbase/mechanicsmanager.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
|
||||
|
@ -451,6 +452,14 @@ namespace MWScript
|
|||
runtime.pop();
|
||||
|
||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().remove (id);
|
||||
|
||||
MWBase::WindowManager *wm = MWBase::Environment::get().getWindowManager();
|
||||
|
||||
if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr() &&
|
||||
id == wm->getSelectedSpell())
|
||||
{
|
||||
wm->unsetSelectedSpell();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue