Well I ran across a problem, or atleast I think it's a problem and that was using var/mob/t as mob and assigning it to usr.client.mob...
of one of the many things I have people do in my game is click on screen objects which activates the proc Click() which is usr friendly (meaning you can only use usr).
anyways
the problem I'm running into is when I try to create a new mob, and have usr.client.mob= new mob in order to switch clients, the problem comes when I want to delete the old mob... what is the best way to do this?
Should I have the deletion of the mob and the transfer of client to new mob in a proc by declaring usr.TransferChar() and then do all the crap in TransferChar?
or is it safe to do a transfer in Click() and then just declare a variable var/mob/t as mob, and then have t=usr.client.mob BEFORE the transfer of client, then at the end have a del(t)?
Any help would be appreciated...
ID:268225
Apr 28 2004, 3:41 pm (Edited on Apr 28 2004, 3:50 pm)
|
|
Well, if you're setting usr.client.mob, you're obviously setting the client to that mob, but - besides that good, it'll work, except more along these lines...
var/mob/player/P=new //define a new mob variable
usr.client.mob=P //set the client to the new mob
del(usr) //delete the old mob