ID:150626
 
okay, heres what I'm doing:

for(var/mob/player/master/M in block(locate(src.x-20,src.y-20,1),locate(src.x+20,src.y+20,1)))
alert("You are trying to set your city too close to another city. Please choose another spot.")
return

it isn't working. What could I be doing wrong, and what woudl be an effective way to fix it?
XgavinX wrote:
okay, heres what I'm doing:

for(var/mob/player/master/M in block(locate(src.x-20,src.y-20,1),locate(src.x+20,src.y+20,1)))
alert("You are trying to set your city too close to another city. Please choose another spot.")
return

it isn't working. What could I be doing wrong, and what woudl be an effective way to fix it?
any solution or explination or is this one of those topics people don't care to help out with? =P
for(var/mob/player/master/M in block(locate(src.x-20,src.y-20,1),locate(src.x+20,src.y+20,1)))
alert("You are trying to set your city too close to another city. Please choose another spot.")
return

it isn't working. What could I be doing wrong, and what woudl be an effective way to fix it?

Ah, this tripped me up recently. The block() statement is returning only a list of turfs, not their contents. You will need to look in each turf's contents individually to make sure there are no mob/player/masters there.
In response to Gughunter
Gughunter wrote:
for(var/mob/player/master/M in block(locate(src.x-20,src.y-20,1),locate(src.x+20,src.y+20,1)))
alert("You are trying to set your city too close to another city. Please choose another spot.")
return

it isn't working. What could I be doing wrong, and what woudl be an effective way to fix it?

Ah, this tripped me up recently. The block() statement is returning only a list of turfs, not their contents. You will need to look in each turf's contents individually to make sure there are no mob/player/masters there.

thank you! I REALLY appreciate that. =)