ID:172929
 
world/New()
WorldLoad()
if(Radar)
Update_Radar()
var/FOUND=0
for(var/mob/choosing/P in world)
if(P.client)
if(P.client.address==world.address || P.client.address==null)
FOUND=1
if(!FOUND)
Started=1
gamemode="Timed Death Match"


I have this, which in theory should find out if the host is in the game. Well it always fails to find out if the host is in the game, so i've obviously done the if()s wrong, so can any one give me any pointers on how to fix? Thanks!

oops forgot dm tags!
Well the host would NEED to be a /mob/choosing.

I find it more user friendly to put that in it's own procedure or a macro so it can easily be used arround the code.
world/New()
WorldLoad()
if(!HostLogged())
Started=1
gamemode="Timed Death Match"

proc/HostLogged()
for(var/mob/M)
if(M.client&&(!M.client.address""M.client.address==world.address)) return 1
In response to Yota
Yes the worlds default mob is choosing

world
mob=/mob/choosing

This game is a game that does NOT save mobs and so at the startup all players are always a "choosing" mob.

Anyways, that proc diddn't help my situation at all..There is no other world/new() proc that i have overwritten so it cant be that...Thanks any way Yota

<edit>
The reason why im doing this is because when the game starts the game usually asks options for the host to change (eg: start the game!, and change options). This is why I thought I should do this, so that way people can host with Dream Daemon.
</edit>
In response to Wanabe
Do any mobs even exist in world/New()?
In response to Garthor
Can you please explain your self a little more, Garthor? Im geussing you mean what you typed

"Are there any mobs already in the game?" If so, yes

<edit> Argh I have read my own post three or four times and I dont even under stand my self, sorry! :-P
</edit>
In response to Wanabe
In the for() loop, count every mob. Then, spawn(10), and output the number.
In response to Garthor
It does not seem like it, I just did this and in the for loop I added the number by one and just did world<<Many to display it. Well it did not display. This helps pinpoint the problem but I have no clue how to fix...
In response to Wanabe
You need to use spawn(10) world << num
In response to Garthor
Oh right, of course cause the world hasn't quite started up :-P, Well the world starts with 1 mob, which I am geussing is my self

<edit1> Thank you I should be able to fix the proc with this information, I will post later </edit1>

<edit2> Yes that was all the information I needed, the spawn(10) part, I actualy thought in world/new it created everything at once, well I was wrong thanks Garthor!

</edit2>
Always always always spawn() out any task in world/New() that can't (or needn't) be done immediately.

Lummox JR