ID:261588
 
When I use this code

verb/Test()
var/A=new/obj/beam/shoot(locate(usr.x+1,usr.y,usr.z))
for(var/obj/beam/shoot/B in oview(1))
if(B.owned==1)
return
else
B.owned=1
B.dir=usr.dir

And then I go and use it in my game it works fine until i stand next to another "shoot" then the one that was supposed to be made is always pointing SOUTH
DBZ Kidd wrote:
When I use this code

verb/Test()
var/A=new/obj/beam/shoot(locate(usr.x+1,usr.y,usr.z))
for(var/obj/beam/shoot/B in oview(1))
if(B.owned==1)
return
else
B.owned=1
B.dir=usr.dir

And then I go and use it in my game it works fine until i stand next to another "shoot" then the one that was supposed to be made is always pointing SOUTH

There seems to be a lot that's nonsensical about your code.
For one thing, why are you bothering to take the value of A if you never use it? Why are you looping through all those B's if you're only interested in the beam you just created (A)? Why are you using locate(usr.x+1,usr.y,usr.z) when you could use get_step(usr,EAST)? Why are you using a numerical var B.owned, instead of making that a var pointing to the mob who fired it, as in B.owner? Why not pass the player who fired and the direction to obj/beam/shoot/New() as extra arguments and save a lot of steps?

Lummox JR
In response to Lummox JR
How do you want me to use get_step with that code?
In response to DBZ Kidd
On the first line of verb/Test(). Change this:

var/A=new/obj/beam/shoot(locate(usr.x+1,usr.y,usr.z))

to this:

var/A=new/obj/beam/shoot(get_step(usr,EAST))

He said it in his post! Please try to read more carefully in future.
In response to Crispy
That didn't do anything, and how is get_step gonna change the direction of something?