mob/var/list/tmpvars = list()
var/var1 = ""
mob
host/verb
Setvar1(T as text)
var1 = T
usr << "Var1 is now [var1]"
Addvar1(mob/M in world)
M.tmpvars += var1
Whats wrong with this?.. It has no errors but when I use the verb those stupid runtime errors pop up.
ID:177131
![]() Oct 27 2002, 11:16 am
|
|
![]() Oct 27 2002, 11:33 am
|
|
what do the errors say?
|
Nevermind I have resolved the problem.. it was being caused by this.
EraseStats(mob/M in world) set category= "Host" var/promptbox = alert("Are you sure you want to delete all of [M] stats?","Erase Stats","Yes","No") if(promptbox == "Yes") M.tmpvars = 0 if(promptbox == "No") return that was supposed to erase all the persons tmpvars.. but it caused runtime errors when trying to add stats to someone so it is fixed now.. =-p ty anyway |
But now I have another problem..I need to make something else to erase all of the persons stats without causing those errors.
|
Jacob wrote:
mob/var/list/tmpvars = list() This isn't a safe way to initialize the list unless you want all mobs to share the same list. What will happen here is that the list is initialized at compile-time and this same list then belongs to all mobs. Any changes to the list will affect every mob. What you should do instead is initialize the list in New() or Login(): mob Lummox JR |