2021-12-05 17:54:36 +00:00
|
|
|
#include "ImaginationShrineServer.h"
|
2023-06-09 22:12:57 +00:00
|
|
|
#include "QuickBuildComponent.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void ImaginationShrineServer::OnUse(Entity* self, Entity* user) {
|
|
|
|
// If the rebuild component is complete, use the shrine
|
2023-06-09 22:12:57 +00:00
|
|
|
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 22:12:57 +00:00
|
|
|
if (quickBuildComponent == nullptr) {
|
2021-12-05 17:54:36 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-06-09 22:12:57 +00:00
|
|
|
if (quickBuildComponent->GetState() == eRebuildState::COMPLETED) {
|
2021-12-05 17:54:36 +00:00
|
|
|
// Use the shrine
|
|
|
|
BaseUse(self, user);
|
|
|
|
}
|
|
|
|
}
|