[FIXED] uox3 crash

Here we stuff all the bugs we've managed to squash/squish/squelch.
Locked
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

uox3 crash

Post 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)
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post 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.
-= Ho Eyo He Hum =-
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post 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?
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

The fix for this is now available in UOX3 0.99, and on the CVS.
-= Ho Eyo He Hum =-
Locked