In theory it's doesn't matter but that's how engine do that.
It's necessary to pay attention while woking with entities especially in your case. You breaks entities "link" which may easily lead to server instability and even crash. Therefore i'd suggest you make your code as safe as possible.
Code:
new c4 = find_ent_by_owner(-1, "weapon_c4", Ent)
remove_entity(Ent)
remove_entity(c4)
There are one more important trick - "natural" entity deleting (remark: me and T(+)rget discovered that method independently).
Here is the stock wich i usually use:
Code:
stock kill_entity(id) {
entity_set_int(id, EV_INT_flags, entity_get_int(id, EV_INT_flags)|FL_KILLME)
}
So in your case safest entity pair deleting would be something like this:
Code:
new c4 = find_ent_by_owner(-1, "weapon_c4", Ent)
entity_set_int(Ent, EV_INT_flags, entity_get_int(Ent, EV_INT_flags)|FL_KILLME)
entity_set_int(c4, EV_INT_flags, entity_get_int(c4, EV_INT_flags)|FL_KILLME)
Or just put the stock somewhere in your code (outside other functions of course) and then the code above would looks like:
Code:
new c4 = find_ent_by_owner(-1, "weapon_c4", Ent)
kill_entity(Ent)
kill_entity(c4)