ID:263491
 
Code:
proc
Ride()
if(usr.riding ==0)
for(var/global/mob/dragons/Dragon/O in oview())
if(usr.mp >= 2)
usr.doing=1
usr.mp -= 2
usr.riding=1
usr.icon_state = "ride"
usr.underlays+=O
usr<<"You go ride your dragon"
usr.doing=0
//usr.verbs+=/mob/ride/verb/dismount
O.loc=locate(0,0,0)

else
usr<<"Not Enough MP"
else
for(var/global/mob/dragons/Dragon/O in world)
usr.doing = 1
usr.riding=0
usr<<"You stop riding your dragon"
if(usr.sex == "male")
usr.icon_state="male"
else usr.icon_state="female"
usr.underlays-=O
usr.underlays-=O
usr.underlays-=O
usr.underlays-=O
usr.doing = 0
BottomDragon()


Problem description: the first half works great and exactly what i want however when i want to unride it picks a random dragon regardless of if the person has their own or not. ive racked my brain but i cant think of how to do it. any suggestions?

If you can't see the obvious bad parts when reading threw this code, read the DM Guide and Reference first before continuing... Some of it simply doesn't make sense.
In response to Kaioken
i know why it picks a random dragon is because i have "in world" but i dont have any idea as to what replace it with.
In response to Chase_Hammer
That's only a part of a part (:P) of all the issues. After reading your other topics, I strongly re-recommend reading the DM Guide and Reference. You seem to have some initial coding abillity, and you need to read those so you actually know what your code is doing and what you should do, plan things before designing them, etc.
In response to Kaioken
im tired of people telling me to read the darn DM guide. ive read the darn thing over already, telling me that does not help me.
In response to Chase_Hammer
Make sure you understand what your code is actually doing, you're using things without knowing how they work/their effects. Look up everything you have used in that code, then carefully follow it's "flow" (read threw it as the computer would when executing it). You seem to tend to just post topics without trying hard to analyze or solve your problem yourself and just have others do so. Thats neither good nor will it last long.