I have a whisper verb that I want to send the msg to in the next tile of the dir im facing. Then check and see if some one is there. If no one is dont send the message. If some one is send them the message.
Whisper(Msg as text)
var/M_loc = get_step(usr,usr.dir)
if(ismob(M_loc))
for(var/mob/M in M_loc)
M << "[usr.name] whispers, [Msg]"
Thats my verb but it doesnt seem to be working would any one know how to do this or maybe whats wrong with my code. Thanks :)
ID:267370
![]() Mar 22 2003, 2:14 am
|
|
First of all, usr is perfectly safe and often neccessary in verbs. Second, you could do the whole thing in one line:
Whisper(Msg as text) |
Green Lime wrote:
I have a whisper verb that I want to send the msg to in the next tile of the dir im facing. Then check and see if some one is there. If no one is dont send the message. If some one is send them the message. Basically the ismob() check is failing, because get_step() will return a turf (or null); it doesn't tell you if a mob is there or not. The shortcut Garthor suggested should work nicely, since it eliminates the bug and then takes out the now-redundant M_loc var. Lummox JR |
Wow, for some odd reason I thought he was using a procedure (No clue why though) so I apologize for that first part with the SRCs.
Secondly, I am more of a game designer and developer than a programmer, I try my best to help but please understand I will not be the most efficient, just a fair amount so. -=Ken=- |
There, that should work...
You were using usr in a proc.. BAAAD! :-)
and I also made it neater and more efficient for you.
-=Ken=-