ID:262419
 
Code:
obj/_8_Shotgun_Shells/verb/load_spas()
set category= "Shotgun"
var/obj/SPAS_12_ = locate(/obj/SPAS_12_) in usr.contents
if(SPAS_12_)
usr << "You begin reloading the shotgun."
view()<< sound('Sounds/reload shotgun.wav')
sleep(3)
usr.ammu = 1
view()<< sound('Sounds/reload shotgun.wav')
sleep(3)
usr.ammu = 2
view()<< sound('Sounds/reload shotgun.wav')
sleep(3)
usr.ammu = 3
view()<< sound('Sounds/reload shotgun.wav')
sleep(3)
usr.ammu = 4
view()<< sound('Sounds/reload shotgun.wav')
sleep(3)
usr.ammu = 5
view()<< sound('Sounds/reload shotgun.wav')
sleep(3)
usr.ammu = 6
view()<< sound('Sounds/reload shotgun.wav')
sleep(3)
usr.ammu = 7
view()<< sound('Sounds/reload shotgun.wav')
sleep(3)
usr.ammu = 8
view()<< sound('cc.wav')
usr.verbs += /mob/spaser/verb/firespas
usr.weight -= 1
src.loc = locate(rand(1,world.maxx),rand(1,world.maxy))
else
usr<<"You need a SPAS 12."


Problem description: When the user loads the shotgun, it wil go through the sounds, and then for some reason gets blackscreened. From what i can figure, it might be the part of the verb where the shells get relocated randomly on the map, but i cant figure why, all my loading verbs work the same way, but they arent having the same problem. can anyone help?

Phantom_X wrote:
Code:
obj/_8_Shotgun_Shells/verb/load_spas()
> set category= "Shotgun"
> var/obj/SPAS_12_ = locate(/obj/SPAS_12_) in usr.contents
> if(SPAS_12_)
> usr << "You begin reloading the shotgun."
> view()<< sound('Sounds/reload shotgun.wav')
> sleep(3)
> usr.ammu = 1
> view()<< sound('Sounds/reload shotgun.wav')
> sleep(3)
> usr.ammu = 2
> view()<< sound('Sounds/reload shotgun.wav')
> sleep(3)
> usr.ammu = 3
> view()<< sound('Sounds/reload shotgun.wav')
> sleep(3)
> usr.ammu = 4
> view()<< sound('Sounds/reload shotgun.wav')
> sleep(3)
> usr.ammu = 5
> view()<< sound('Sounds/reload shotgun.wav')
> sleep(3)
> usr.ammu = 6
> view()<< sound('Sounds/reload shotgun.wav')
> sleep(3)
> usr.ammu = 7
> view()<< sound('Sounds/reload shotgun.wav')
> sleep(3)
> usr.ammu = 8
> view()<< sound('cc.wav')
> usr.verbs += /mob/spaser/verb/firespas
> usr.weight -= 1
> src.loc = locate(rand(1,world.maxx),rand(1,world.maxy))
> else
> usr<<"You need a SPAS 12."
>

Problem description: When the user loads the shotgun, it wil go through the sounds, and then for some reason gets blackscreened. From what i can figure, it might be the part of the verb where the shells get relocated randomly on the map, but i cant figure why, all my loading verbs work the same way, but they arent having the same problem. can anyone help?


Check to see what src is just before you change its location O.o.
world.log << src
In response to Green Lime
hmm, i loaded once, the src was still the shotgun shells, loaded again, it changed me to the src, why?