diff --git a/artifacts/mods/gl_partycontrol.int b/artifacts/mods/gl_partycontrol.int index ce8f92b4..dae6ac02 100644 Binary files a/artifacts/mods/gl_partycontrol.int and b/artifacts/mods/gl_partycontrol.int differ diff --git a/artifacts/mods/gl_partycontrol.ssl b/artifacts/mods/gl_partycontrol.ssl index cf0254c2..29f8225e 100644 --- a/artifacts/mods/gl_partycontrol.ssl +++ b/artifacts/mods/gl_partycontrol.ssl @@ -23,7 +23,7 @@ variable noCheckArray, pidList, lightInt, lightDist, npcControl, - displayName, displayNameColor, + displayName, displayNameColor, isShowTag, inControl := false, hasGeckoSkinning := false; @@ -43,7 +43,7 @@ procedure combatturn_handler begin //display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + ", arg3: " + arg3); if npcControl then begin if lightInt then lightInt := round((lightInt / 65536.0) * 100); // calc percent of intensity - obj_set_light_level(npcControl, lightInt, lightDist); // restore/off light for NPC + obj_set_light_level(npcControl, lightInt, lightDist); // restore light for prev. controlled NPC end pid := obj_pid(critter); @@ -59,23 +59,29 @@ procedure combatturn_handler begin if hasGeckoSkinning then critter_add_trait(critter, TRAIT_PERK, PERK_gecko_skinning_perk, 1); inControl := true; end else if npcControl then begin - obj_set_light_level(dude_obj, 100, 4); // set default light - npcControl := 0; + obj_set_light_level(dude_obj, 100, 4); // set dude default light + npcControl := 0; // dude control end if inControl then begin - // center the screen on the controlled critter and remove roof tiles + // center the screen on the controlled critter/dude and remove roof tiles move_to(dude_obj, dude_tile, dude_elevation); if (displayName and critter != real_dude_obj) then begin set_iface_tag_text(displayName, obj_name(critter), displayNameColor); show_iface_tag(displayName); + isShowTag := true; end end end else if inControl then begin - if displayName then hide_iface_tag(displayName); - if ((status == 0 or status == -1) and dude_obj != real_dude_obj) then begin - set_dude_obj(real_dude_obj); - obj_set_light_level(dude_obj, 100, 4); - npcControl := 0; + if isShowTag then begin + hide_iface_tag(displayName); + isShowTag := false; + end + if (status < 0 or AllowControl(pid) == false) then begin + if (dude_obj != real_dude_obj) then begin + set_dude_obj(real_dude_obj); + obj_set_light_level(dude_obj, 100, 4); + npcControl := 0; + end end end end @@ -84,12 +90,13 @@ procedure gamemodechange_handler begin if not(hasGeckoSkinning) then hasGeckoSkinning := has_trait(TRAIT_PERK, real_dude_obj, PERK_gecko_skinning_perk); if (inControl and not(get_game_mode BWAND COMBAT)) then begin inControl := false; + npcControl := 0; move_to(dude_obj, dude_tile, dude_elevation); end end procedure inventorymove_handler begin - if (inControl and get_sfall_arg == 3) then begin // armor slot + if (npcControl and get_sfall_arg == 3) then begin // armor slot if (obj_pid(dude_obj) == PID_MARCUS or proto_data(obj_pid(dude_obj), cr_body_type) != CR_BODY_BIPED) then begin display_msg(message_str_game(GAME_MSG_PROTO, 675)); set_sfall_return(true);