i have a problem with removing an entity
function place_item1()
{
if ((mouse_map == pointer_pcx) || (item1_placed == 1)) {return;}
if (mouse_map == shield_pcx) // picked up the shield
{
item_ptr = shield_pan;
player_weapon = my;
shield_pan.visible = off;
ent_create(shield_mdl, player.x, attach_shield);
shield_on = 1;
item_ptr.pos_x = 117; // set the proper position for the item
item_ptr.pos_y = 698; // on the x and y axis
item_ptr.visible = on; // and make it visible
item1_placed = 1; // slot1 is occupied
mouse_map = pointer_pcx; // restore the initial bitmap (the arrow)
show_pointer = 0; // hide the mouse pointer
}
If ((mouse_map != pointer_pcx) && (item1_placed != 1)) { ent_remove(player_weapon);
}
}
watch the follogwing red part, the entity doestn`t remove!