Skip to content

Commit

Permalink
ScriptedNPC: Orphan spells cast by potion_* items
Browse files Browse the repository at this point in the history
Fixes: issue #1048
  • Loading branch information
dscharrer committed Jun 30, 2021
1 parent afd64e8 commit 6e92b15
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/script/ScriptedNPC.cpp
Expand Up @@ -43,6 +43,8 @@ ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.

#include "script/ScriptedNPC.h"

#include <boost/algorithm/string/predicate.hpp>

#include "game/Camera.h"
#include "game/EntityManager.h"
#include "game/NPC.h"
Expand Down Expand Up @@ -173,6 +175,12 @@ class SpellcastCommand : public Command {
long duration = -1;
bool haveDuration = false;

if((context.getEntity()->ioflags & IO_ITEM)
&& boost::starts_with(context.getEntity()->id().className(), "potion_")) {
// TODO(patch-scripts) Workaround for http://arx.vg/1048
spflags |= SPELLCAST_FLAG_ORPHAN;
}

HandleFlags("kdxmsfz") {

if(flg & flag('k')) {
Expand Down

0 comments on commit 6e92b15

Please sign in to comment.