ID:263493
 
Code:
proc/LoadObjects()                         //Its time to load the objs!
var/savefile/F = new ("map.sav")
var/list/L = new
F[""] >> L
if(!L) return
for(var/obj/O in world) if(O.loc) del(O)
for(var/obj/O in L)
O.loc = locate(O.saved_x,O.saved_y,O.saved_z)


Problem description: when i call the Proc it loads the locations of items on the map but it also removes items in users contents. how do i stop this?

anyhelp?
In response to Chase_Hammer
It's because you check for all the items in the world, and if they have a location, delete them. Since the player is a location, the item they have are deleted.
In response to Pyro_dragons
Bullseye. Chase_Hammer really needs to think and test things before lazying and just posting a new topic so people have to be bothered to tell him the simple problem.
In response to Kaioken
I KNOW THE FREAKIN PROBLEM...

its how to fix it that i dont know. i have to have the del because i dont want the same item put there twice
In response to Chase_Hammer
Again... think before you post, you just want to be spoon-fed with everything. This is really simple...
So it loops threw all objs and deletes them, right? But you don't want to delete objs inside players/mobs (or, you want to delete only objs which are inside turfs). So add a check before the deletion that won't delete the obj if it isn't in a turf.
Pretty compilcated stuff, huh?