ID:182159
 
Coding Before:
Bump(obj/Enemy/M)
if(istype(M,/obj/Enemy))
if(M)
M.HP
if(M.HP <= 0)
M.loc = locate(1,0,1)
spawn(500) del(M)
for(var/mob/N in world)//<-----Problem
N.gold += 1 + (1* round(N.wave/4))

Coding After:
Bump(obj/Enemy/M)
if(istype(M,/obj/Enemy))
if(M)
M.HP
if(M.HP <= 0)
M.loc = locate(1,0,1)
spawn(500) del(M)
for(var/mob/N in world)//<-----Fixed
N.gold += 1 + (1* round(N.wave/4))

It gave the person gold regardless of the enemy dying or not.
Um, congratulations? I thought it would be obvious as it is outside the if()s...

And I hope you didn't indent it after the del(src), otherwise it won't be called since the procedure will be terminated right there.
In response to GhostAnime
Actually it's kind of scrambled. It's supposed to delete the obj before the bullet.
In response to Choka
Still, if you're deleting the src before you mess with the gold, no one gets it!
In response to Jeff8500
I know, I fixed that as well.
In response to Choka
Choka wrote:
I know, I fixed that as well.

Why would you post faulty code and call it fixed? More importantly, what's special about this situation? Developers do this kind of thing on a daily basis.
In response to CaptFalcon33035
Because, I hadn't noticed it at all. Ontop of that the coding is outdated. I found no need to update it here when it quite clearly works.
In response to Choka
You NEED to update it here in case someone comes by and looks at it, who the HECK posts broken code on the forums, are you CRAZY!?
In response to Flame Sage
Possibly.
In response to Choka
Choka wrote:
Because, I hadn't noticed it at all. Ontop of that the coding is outdated. I found no need to update it here when it quite clearly works.

Then why did you post it? You are only misleading users. This is quite possibly the most worthless thread I have ever seen--providing misleading information and going nowhere. Now let's bring in the fact that it was started for no reason and the OP refuses to update his misleading code on the topic post...

[edit]
Okay, I see you edited the post, so thank you!

By the way, you can just set M.loc to null. You also may want to use a Bumped() procedure so that you may let Bump() proceed as intended. And this line does nothing: if(M) M.HP.
In response to CaptFalcon33035
Actually I did update it, a bit ago.
In response to CaptFalcon33035
CaptFalcon33035 wrote:
Then why did you post it? You are only misleading users. This is quite possibly the most worthless thread I have ever seen--providing misleading information and going nowhere. Now let's bring in the fact that it was started for no reason and the OP refuses to update his misleading code on the topic post...

I have to point out two things here:
1) No moderators have so far deleted this thread, which would be the case if your statements were true.
2) If you believe that this post is useless, why are you bothering to reply to it? If you don't, it'll die out more quickly than if you do, and it also avoids trolling.

Just a thought.

-01000100010101000100000100110011001100000011000100110001-

<small>Note: Not directly against you (your post pretty much sums it up), so don't take this personally or anything.</small>
In response to Android Data
Android Data wrote:
I have to point out two things here:
1) No moderators have so far deleted this thread, which would be the case if your statements were true.
2) If you believe that this post is useless, why are you bothering to reply to it? If you don't, it'll die out more quickly than if you do, and it also avoids trolling.

Valid points indeed. My aim was to get him to merely update his code, which he did so I am happy. :)
In response to CaptFalcon33035
This thread may now die in peace...