796 {
797 bool type;
798
799 if ( tool )
800 {
801
802 type = tool.ConfigGetBool("RestrainUnlockType");
803 }
804 string new_item_name = current_item.ConfigGetString( "OnRestrainChange");
805
806 if ( new_item_name != "" )
807 {
808 if ( player_target )
809 {
810 if (player_target.IsAlive())
811 MiscGameplayFunctions.TurnItemIntoItemEx(player_target,
new ReplaceAndDestroyLambdaEx(current_item, new_item_name, player_target, type));
812 else
814 }
815 else
816 {
817 MiscGameplayFunctions.TurnItemIntoItemEx(player_target,
new ReplaceAndDestroyLambdaEx(current_item, new_item_name, player_target, type));
818 }
819 }
820 else
821 {
822 Error(
"current_item:" +current_item+
", tool:" +tool +
". No value for 'OnRestrainChange' config parameter");
823 }
824 }
void Error(string err)
Messagebox with error message.