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,7 +136,9 @@ protected func Initialize()
// a consumer anymore, it must always be unregistered from the power network.
protected func Destruction()
{
UnregisterPowerRequest();
// Only unregister if this object actually is a consumer.
if (IsPowerConsumer())
UnregisterPowerRequest();
return _inherited(...);
}