mud/world/playeravatar.py
Above def perspective_endLooting(self) add the following
#called from simmind when a player is casting and has been detected moving
def perspective_stopCasting(self):
for char in self.player.party.members:
if (char.mob.casting):
char.mob.casting.cancel()
mud/simulation/simmind.py
Change the from math statement to look like this
from math import radians,sqrt,fabs
In class SimMind? find the following
self.updateSimObjects()
self.tickBrains()
After it add the following
self.checkVelocity()
Find def updateCansSee(self) and before it add this function
#4x a seconds it checks for velocity changes (movement). Currently used to stop spells
def checkVelocity(self):
try:
#find a simObject for the player...could be online or off with multiple objects
for so in self.simObjects:
#need a brain....need to check casting
if so.brain and so.brain.iscasting:
tgeObject = so.tgeObject
vel = tgeObject.getVelocity()
if fabs(vel[0]) > .1 or fabs(vel[1]) > .1:
self.perspective.callRemote("PlayerAvatar","stopCasting")
so.brain.cast(False)
except:
print_exc()
self.velocityTick = reactor.callLater(.25,self.checkVelocity)

