859 {
860 bool type;
861
862 if ( tool )
863 {
864
865 type = tool.ConfigGetBool("RestrainUnlockType");
866 }
867 string new_item_name = current_item.ConfigGetString( "OnRestrainChange");
868
869 if ( new_item_name != "" )
870 {
871 if ( player_target )
872 {
873 if (!player_target.IsAlive() || destroy)
874 {
876 }
877 else
878 {
879 MiscGameplayFunctions.TurnItemIntoItemEx(player_target,
new ReplaceAndDestroyLambdaEx(current_item, new_item_name, player_target, type));
880 }
881 }
882 else
883 {
884 MiscGameplayFunctions.TurnItemIntoItemEx(player_target,
new ReplaceAndDestroyLambdaEx(current_item, new_item_name, player_target, type));
885 }
886 }
887 else
888 {
889 Error(
"current_item:" +current_item+
", tool:" +tool +
". No value for 'OnRestrainChange' config parameter");
890 }
891 }
void Error(string err)
Messagebox with error message.