Page 1 of 1

uox3 crash

Posted: Tue Jan 24, 2012 11:41 pm
by dragon slayer
here is what couased the crash on uox3 when i had a monster with spattack=8 and spelldelay=8

Code: Select all

[January 24 04:39:23 PM] JS script failure: Script Number (600) Message (TypeError: mSock has no properties)
[January 24 04:39:23 PM] Filename: ./js/magic/clumsy.js
| Line Number: 24
[January 24 04:39:23 PM] Erroneous Line: (null)
| Token Ptr: (null)

Re: uox3 crash

Posted: Wed Jan 25, 2012 3:27 am
by Xuri
To fix, replace
var spellType = mSock.currentSpellType;
with
var spellType = mChar.currentSpellType;

Also add the following before every mSock.SysMessage() line to make sure it doesn't happen elsewhere:
if( mSock )

This should be a general rule for any script shared by players and NPCs, really; only players can ever have a "socket", aka a network connection to the server.

Re: uox3 crash

Posted: Wed Jan 25, 2012 3:37 am
by dragon slayer
thats always a good idea hehe.

this makes me think tho if npcs can cast spells using js.

Can we make npcs use other stuff like maybe fire my cannons or sail a boat?

Re: uox3 crash

Posted: Mon Mar 19, 2012 1:13 pm
by Xuri
The fix for this is now available in UOX3 0.99, and on the CVS.