Having the following mouse click handle:
changing the active player item (by pressing B key) the pid of the player holding weapon doesn't change - it reports the same pid for left and right hand regardless of swapping hands by pressing the B key.
Code:
procedure my_mouse_click begin
variable event := get_sfall_arg_at(0);
variable button := get_sfall_arg_at(1);
if event == 1 then begin
if button == 1 then begin
variable ttt := get_weapon_ammo_pid(dude_obj);
variable leftHand := obj_pid(critter_inven_obj(dude_obj, INVEN_TYPE_LEFT_HAND));
variable rightHand := obj_pid(critter_inven_obj(dude_obj, INVEN_TYPE_RIGHT_HAND));
variable msg := string_format("1 rightHand: %d, leftHand: %d", rightHand, leftHand);
display_msg(msg);
leftHand := obj_pid(critter_inven_obj2(dude_obj, INVEN_TYPE_LEFT_HAND));
rightHand := obj_pid(critter_inven_obj2(dude_obj, INVEN_TYPE_RIGHT_HAND));
msg := string_format("2 rightHand: %d, leftHand: %d", rightHand, leftHand);
display_msg(msg);
end
end
end
changing the active player item (by pressing B key) the pid of the player holding weapon doesn't change - it reports the same pid for left and right hand regardless of swapping hands by pressing the B key.