2021-12-05 17:54:36 +00:00
|
|
|
#include "ImaginationShrineServer.h"
|
|
|
|
#include "RebuildComponent.h"
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void ImaginationShrineServer::OnUse(Entity* self, Entity* user) {
|
|
|
|
// If the rebuild component is complete, use the shrine
|
|
|
|
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
if (rebuildComponent == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
if (rebuildComponent->GetState() == REBUILD_COMPLETED) {
|
|
|
|
// Use the shrine
|
|
|
|
BaseUse(self, user);
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|