Author Topic: The shots erray is locked temporarly  (Read 7545 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
The shots erray is locked temporarly
« Reply #15 on: June 16, 2005, 07:01:01 PM »
Num, when it goes to makepuff it calls on createshot and then it does redim the shots array...

If you have With array anywere and even through a stack of nested calls you try to redim that array , that "with" statement will keep it locked.
I just tryed it without the "with" in the "updateshots" , it worked fine.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
The shots erray is locked temporarly
« Reply #16 on: June 16, 2005, 07:04:34 PM »
Quote
If you have With array anywere and even through a stack of nested calls you try to redim that array , that "with" statement will keep it locked.

I just tryed it without the "with" in the "updateshots" , it worked fine.
Are you sure, or are you assuming?  Did it actually trip an error?  Since we're not passing an array element to makepoff, I don't think it will cause any problems.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
The shots erray is locked temporarly
« Reply #17 on: June 16, 2005, 07:05:27 PM »
LOL < NO SHIT IT ACTUALY TRIPED  THE ERROR I NEVER "ASSUME" STUFF LIKE THIS.

and without that "with" statement the error was gone!
« Last Edit: June 16, 2005, 07:06:16 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
The shots erray is locked temporarly
« Reply #18 on: June 16, 2005, 07:16:14 PM »
Code: [Select]
Private Sub takepoison(n As Integer, t As Integer)
  If Shots(t).FromSpecie = rob(n).fname Then    'Robot is imune to poison from his own species
    rob(n).poison = rob(n).poison + Shots(t).value 'Robot absorbs poison fired by conspecs
    If rob(n).poison > 32000 Then rob(n).poison = 32000
    rob(n).mem(827) = rob(n).poison
  Else
    Dim power As Long
    
    power = Shots(t).nrg / Shots(t).range * Shots(t).value
    
    rob(n).Poisoned = True
    rob(n).Poisoncount = rob(n).Poisoncount + power
    If rob(n).Poisoncount > 32000 Then rob(n).Poisoncount = 32000
    If Shots(t).Memloc > 0 Then
      rob(n).Ploc = Shots(t).Memloc
    Else
      rob(n).Ploc = Int(Rnd * 1000) + 1
    End If
  End If
  Shots(t).Exist = False
End Sub

I don't see a killrobot.  DId you add that to your source?
« Last Edit: June 16, 2005, 07:18:39 PM by Numsgil »