Bump(mob/M)
if(ismob(M))
ownerk.firing = 0
ownerk.icon_state = ""
ownerk.move = 1
usr.strength -= M.powerlevel
M.Die(src)
for(var/obj/O in src.Beam).
del(O)
del(src)
But when i use the fire verb at somone else there pl does not go down.
ID:173339
Jan 16 2004, 5:50 am
|
|
Hello please can someone help me with this i have
Bump(mob/M) But when i use the fire verb at somone else there pl does not go down. |
You're going to need a bit more code than that for anyone to really diagnose your problem. If your issue is with the fire verb, it might be a good idea to paste the fire verb. If its just with this proc, you might want to explain a bit about what you're trying to do.
|
In response to Lummox JR
|
|
DerDragon wrote:
You're going to need a bit more code than that for anyone >to really diagnose your problem. If your issue is with >the fire verb, it might be a good idea to paste the fire >verb. If its just with this proc, you might want to >explain a bit about what you're trying to do. Lummox JR wrote: No put usr in Bump(). Ungh. Lummox JR if i do the bump thing i can't use M. DerDragon here is some more of the coding. Bump(mob/M) |
In response to CrazyFighter
|
|
CrazyFighter wrote:
Lummox JR if i do the bump thing i can't use M. No put usr in Bump()! Ungh! No forget about src. No put usr in proc like Beam(). Ungh. Lummox JR |
In response to Lummox JR
|
|
Amazingly, usr IS the cause of the current problem! People really have to stop using usr in their procedures, and stop ignoring Lummox when he says that you shouldn't because it isn't a problem for them at the moment.
|
In response to Jon88
|
|
so can anyone help me.
|
In response to CrazyFighter
|
|
Lummox JR already has. TWICE.
|
In response to Garthor
|
|
I think he was confused by my post. I had a word in there implicitly, after an and, and I guess he didn't pick up on it. It looked like pretty bad grammar too. I've edited it now.
|
In response to Lummox JR
|
|
Lummox JR wrote:
No put usr in Bump(). Ungh. so Bump(mob/usr) or Bump(usr) |
In response to CrazyFighter
|
|
CrazyFighter wrote:
Lummox JR wrote: "No put usr in Bump(). Ungh" = "Do NOT put usr in Bump()!" |
In response to CrazyFighter
|
|
CrazyFighter wrote:
so Bump(mob/usr) or Bump(usr) Good gads, man, I know the caveman thing is kind of facetious but it did tell you what not to do. What not to do is put usr in Bump(), or in your Beam() proc either. How do you make the leap from not only failing to get that, but actually renaming your argument to usr? Renaming an argument to usr or src is ludicrous. In the case of usr, you forget that usr is already a local var passed to the proc and is already defined; you'd have two different vars named usr. In the case of src, that's already defined as well. Don't give a proc argument the same name as a built-in var. That ought to be obvious. In the case of Bump(), you have two things to work with: src (the bumper), and your argument M (the bumpee). You had usr in a place where it should have been src. Now src is not always the correct var to replace usr with, but in this case it was. For Beam(), I don't know if src is the right replacement, but usr is absolutely wrong. If your proc doesn't have enough information already to know who fired, then pass that along as another argument. Lummox JR |
In response to Lummox JR
|
|
Lummox JR wrote:
Don't give a proc argument the same name as a built-in var. That ought to be obvious. Agreed. But I reckon the compiler should give a warning when someone defines usr or src, or even defines a local var that has the same name as one of src's vars. I've been seeing people put usr and src in as arguments more and more recently, and a compiler warning to head them off might help a bit. |
Lummox JR