fix script error in power library when a foundry (not really a consumer) is removed

objectmenu
Maikel de Vries 2016-01-29 11:40:08 +01:00
parent 4e73a84d18
commit 5927e55973
1 changed files with 3 additions and 1 deletions

View File

@ -136,6 +136,8 @@ protected func Initialize()
// a consumer anymore, it must always be unregistered from the power network.
protected func Destruction()
{
// Only unregister if this object actually is a consumer.
if (IsPowerConsumer())
UnregisterPowerRequest();
return _inherited(...);
}