ID:1073677
 
(See the best response by Jemai1.)
Code:
player
var/tmp
combat/attack_scheme = null
combat_obj/antelope/shield/shield = null
const
STATE_NORMAL = 16
STATE_DEFEND = 32
state = STATE_NORMAL

proc
start_shield()
if( state != STATE_NORMAL) return
state = STATE_DEFEND

stop_shield()
world << "pressssseed"
if( state == STATE_NORMAL) return
state = STATE_NORMAL
////////////////////////// combat structure /////////////////////////

combat
proc
ATTACK4(player/p)
HOLD4(player/p)
RELEASE4(player/p)

antelope_warrior

ATTACK4(player/p)
p.start_shield()
p.shield = new/combat_obj/antelope/shield(p)
HOLD4(player/p)
p.start_shield()
p.shield = new/combat_obj/antelope/shield(p)
RELEASE4(player/p)
p << "release triggered"
if( p.state == p.STATE_DEFEND )
p << "should be deleting. [p.shield]"
del p.shield
p.stop_shield()

////////////////////////// shield object /////////////////////////
combat_obj
antelope
New(player/p)
..()
SET_BOUNDS()

SET_BOUNDS()
loc = owner.loc
dir = owner.dir
step_x = owner.step_x
step_y = owner.step_y

shield
icon = 'ant_shield.dmi'
icon_state = ""
step_size = 16

New(player/p)
..()

Del()
world << "delete is being called"
..()

Move()
..()

proc
refresh_shield()
icon_state = "[owner.shield_life]" //or shield

shield(src)
owner.shield_life--
refresh_shield()


Problem description:

So I am setting up macros. I have "attack()/ hold()/ release()" functions. For some reason the release() function doesnt delete the shield when i use the "hold()" function. It works just fine when i just press it once though. Basically for attack(), release() will work fine.

Debugging-
-all deletion outputs are working.
-if i hold() and then move around for some reason the release() delete works. -_-
Best response
What happens on you shield's New proc? It seems you have a design problem. On hold, you are calling it again and again while you are cleaning up once only. I'm not quite sure since I can't see the code for that.
Ah! That did the trick. Idk if its good reading or just pure experience that led you to that. All I know is, I would've never figured that out. I was so focused on "deleting", that I thought dream maker was going crazy, lol. Thanks again.