obj/ForSale
name = "For Sale Sign"
icon = 'HouseSign.dmi'
density = 0
layer = HOUSE_LAYER
var
Waiting = 0
verb
Buy_House()
set src in oview(1)
set category = "House"
var/mob/player/P = usr
if(src.Waiting)
return
if(P.HasHouse)
P << "<b>You already own a house."
return
else
src.Waiting = 1
P.loc = locate(P.x,P.y-1,P.z)
P.oLoc = P.loc
var/swapmap/House = SwapMaps_CreateFromTemplate("House")
sleep(10)
House.SetID("files/House_[P.ckey][P.SaveSlot]")
House.Save()
var/turf/T = locate(House.x1+11,House.y1+1,House.z1)
P.loc = locate(P.x,P.y-2,P.z)
P.loc = T
P.HasHouse = 1
var/obj/PlayerHouse/B4/PH = new/obj/PlayerHouse/B4(src.loc)
PH.Owner = P
PH.name = "[P]'s House"
PH.Loaded = 1
src.Waiting = 0
del(src)
mob
player
Bump(A)
..()
if(istype(A,/obj/PlayerHouse/B4))
var/obj/PlayerHouse/B4/D = A
var/mob/player/P = src
var/swapmap/Found
if(D.Owner == P && P.HasHouse)
if(!D.Loaded)
Found = SwapMaps_Load("files/House_[P.ckey][P.SaveSlot]")
D.Loaded = 1
else
Found = SwapMaps_Find("files/House_[P.ckey][P.SaveSlot]")
if(Found)
var/turf/T = locate(Found.x1+11,Found.y1+1,Found.z1)
P.oLoc = P.loc
P.loc = T
else
P << "<b>You do not own this house."
Problem description: Creating the house and then entering it works fine, but if you relog it doesn't let you back into the house. Am I handling the loading incorrectly? I'm not quite sure what's going wrong. Any insight would be helpful.