ID:145613
 
Code:
    Victory()
var/CPPool
var/ExpPool
var/Party
sleep(10)
for(var/mob/Player/A in world)
if(A.z == src.z)
A.ExpGain = 0
A.CPGain = 0
A.AttackUp = 0
ExpPool = round(ExpPool)
CPPool = round(CPPool)
if(A.PartyPosition == 1)
Party = A.Partysize
if(A.icon_state == "Down")
return
ExpPool+=A.ExpGain
CPPool+=A.CPGain
ExpPool = ExpPool/Party
CPPool = CPPool/Party
ExpPool = round(ExpPool)
CPPool = round(CPPool)
src<<sound('mm3selected.mid')
for(var/mob/A in src.group)
A<<sound('mm3selected.mid')
for(var/mob/Player/A in world)
if(A.z == src.z)
A<<"Victory!"
flick("Victory",A)
if(A.icon_state == "Down")
spawn(0)
A.HP = 1
sleep(70)
return
for(var/mob/Player/B in world)
if(B.z == A.z)
if(B.PartyPosition == 1)
A.Exp += ExpPool/B.Partysize
A.CP += CPPool/B.Partysize
spawn(0)
sleep(10)
A<<"You gain [ExpPool] exp."
sleep(10)
A<<"You gain [CPPool] CP."
sleep(70)
for(var/mob/Player/A in world)
if(A.z == src.z)
if(A.PartyPosition == 1)
A.inbattle = 0
A.inmenu = 0
A<<sound('Needle Stage.mid',1)
A.client.lazy_eye = 0
for(var/obj/Face/C in world)
if(C.z == A.z)
del(C)
A.close_menu()
A.dir = EAST
A.icon_state = "Left"
A.loc = locate(A.lastx,A.lasty,A.lastz)
for(var/mob/Player/B in A.group)
B.inbattle = 0
B.inmenu = 0
B<<sound('Needle Stage.mid',1)
B.client.lazy_eye = 0
B.close_menu()
B.dir = EAST
B.icon_state = null
B.loc = A.loc
return


Problem description:

Get ready for the messiest code ever. My problem is when I had my var at 0 hp, it doesnt play through the code. I;m sure that this code can be shorter and all, i just want to find the error.
Sorry im not touching that :D
I don't see where you have anything that even asks about your HP being zero. Perhap you're showing us the wrong snippet. Show us where this proc is being called or somthing.

~Text

Edit: Also try including some Debug messages in various places of the proc to see if it is even being called at all.
In response to A.T.H.K
Yes i beat it with the ugly stick, I am very sorry, but i believe it's the if statement where the icon_State = 0.
I'm going to go through the code again and post.