2021-12-05 17:54:36 +00:00
|
|
|
#include "ImaginationShrineServer.h"
|
2023-12-29 04:24:30 +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-12-29 04:24:30 +00:00
|
|
|
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-12-29 04:24:30 +00:00
|
|
|
if (quickBuildComponent == nullptr) {
|
2021-12-05 17:54:36 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-12-29 04:24:30 +00:00
|
|
|
if (quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
2021-12-05 17:54:36 +00:00
|
|
|
// Use the shrine
|
|
|
|
BaseUse(self, user);
|
|
|
|
}
|
|
|
|
}
|