WiseRock Posted January 3, 2013 Author Share Posted January 3, 2013 Hello, When I was making some spells this error popped-up"Runtime Error '9'"it highlights```CopyMemory ByVal VarPtr(Spell(spellnum)), ByVal VarPtr(SpellData(0)), SpellSize```from the Sub```Private Sub HandleUpdateSpell(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim spellnum As LongDim Buffer As clsBufferDim SpellSize As LongDim SpellData() As Byte' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerSet Buffer = New clsBufferBuffer.WriteBytes Data()spellnum = Buffer.ReadLongSpellSize = LenB(Spell(spellnum))ReDim SpellData(SpellSize - 1)SpellData = Buffer.ReadBytes(SpellSize)CopyMemory ByVal VarPtr(Spell(spellnum)), ByVal VarPtr(SpellData(0)), SpellSizeSet Buffer = Nothing' Update the spells on the picSet Buffer = New clsBufferBuffer.WriteLong CSpellsSendData Buffer.ToArray()Set Buffer = Nothing' Error handlerExit Suberrorhandler:HandleError "HandleUpdateSpell", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub```This started happening after I added[Spell Scaling](http://www.touchofdeathforums.com/community/index.php?/topic/116465-eo-complex-spell-scaling-equation-server-only/)[Spell Scaling for Warriors](http://www.touchofdeathforums.com/community/index.php?/topic/125131-eospell-scaling-for-warriors/)and lastly[This Bug Fix for Spells](http://www.touchofdeathforums.com/community/index.php?/topic/131259-having-more-than-23-spells-flood-server-bug-fix/) Link to comment Share on other sites More sharing options...
Stach Posted January 3, 2013 Share Posted January 3, 2013 I'm going to go ahead and make an educated guess and say that your 'spellnum' is larger than the range of the array. Link to comment Share on other sites More sharing options...
blkcrow Posted January 3, 2013 Share Posted January 3, 2013 make sure SpellRec in modTypes is exactly the same in server and client Link to comment Share on other sites More sharing options...
WiseRock Posted January 4, 2013 Author Share Posted January 4, 2013 > make sure SpellRec in modTypes is exactly the same in server and clientThanks now it works> I'm going to go ahead and make an educated guess and say that your 'spellnum' is larger than the range of the array.Thanks for Trying! Appreciate it!This is now Locked Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now