You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vanilla issue when attack lands on a target with one of these flags:
DAM_DROP - should drop target's weapon on his feet. Instead nothing happens.
DAM_DESTROY - should destroy weapon in target's hands. Instead weapon in attacker's hand is destroyed.
The reason - show_damage_to_object has parameters:
critter - this can is either attacker (on, e.g. critical failures) or target (or extras etc.)
weapon - weapon used by attacker for the attack.
When internal_destroy or obj_drop is called, these parameters are always passed to these functions. So for flags on attacker they will work correctly, but not for normal attacks.
The text was updated successfully, but these errors were encountered:
I manage to work around this with a script using HOOK_COMBAT_DAMAGE:
procedure combatdamage_handler begin
variable
target := get_sfall_arg_at(0),
attacker := get_sfall_arg_at(1),
targetFlags := get_sfall_arg_at(4),
attackerFlags := get_sfall_arg_at(5);
if (target and attacker and (attackerFlags bwand DAM_HIT) and (targetFlags bwand DAM_DROP)) then begin
variable targetWeapon := get_active_weapon(target);
if (targetWeapon) then begin
rm_obj_from_inven(target, targetWeapon);
move_to(targetWeapon, tile_num(target), elevation(target));
//debug_log_fmt("DAM_DROP fix: %s drops %s", obj_name(target), obj_name(targetWeapon));
end
end
end
Would be still a good idea to fix it at some point, maybe in CE.
Vanilla issue when attack lands on a target with one of these flags:
The reason - show_damage_to_object has parameters:
When
internal_destroy
orobj_drop
is called, these parameters are always passed to these functions. So for flags on attacker they will work correctly, but not for normal attacks.The text was updated successfully, but these errors were encountered: