turf/var/gang_name=""
turf/houses
var/purchasing=0
House1
var/price=1000
HouseEnter
Enter(var/mob/player/M)
if(!M) return
if(src.gang_name==""||src.gang_name==null)
if(M.InGang)
switch(alert(M,"Do you wish to buy this Gang Hideout for $1,000?","Buy Hideout","Yes","No"))
if("Yes")
if(M.hideoutbuyer)
M << "You already bought a hideout!"
return
if(src.buying)
usr<<"Someone is currently attempting to purchase this hideout! Wait your darn turn."
return
src.buying=1
if(M.cash < src.cost)
M <<"Error: Insufficient Funds-Come back when you're actually worth money."
src.buying=0
return
if(src.gang_name!= "")
M << "This hideout already belonds to someone! You better run before they see you!"
src.buying=0
return
else
src.gang_name=M.gang
for(var/turf/houses/House1/A in world)
H.gang_name=M.gang
hideouts.Add(A)
var/savefile/B=new("World Save Files/hideouts.sav")
B<<hideouts
src.hideoutowner=M.name
M.cash -= cost
M <<"Purchase Successful."
M.hideoutbuyer=1
src.buying=0
return
else
M << "You must be in a gang to purchase a gang hideout!"
src.buying=0
return
else
if(src.gang_name==M.gang)
M <<"Welcome to [src.gang_name]! Enjoy the life of crime"
M.loc=locate(122,194,1)
return
else
M<<"This gang hideout belongs to [src.gang_name]!"
return
world
New()
..()
var/savefile/A=new("World Save Files/hideouts.sav")
A>>hideouts
if(isnull(hideouts))hideouts = new /list
Del()
..()
Problem description:
When using the savefile editor, it shows that the savefile generates the gang_name, however, upon rebooting the game, it doesn't reload the gang_name into the purchased hideout. I am a little confused at this point on what I need to do to get this correct.
I recommend outputting the contents of the hideouts list at both points where you save and load it, including outputting the values of the variables associated with the items in the list.