Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Ext/Techno/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
auto const pType = pTypeExt->OwnerObject();
auto const pThis = this->OwnerObject();
// Besides BuildingClass, calling pThis->WhatAmI() here will only result in AbstractType::None
auto const whatAmI = pType->WhatAmI();

Check warning on line 21 in src/Ext/Techno/Body.cpp

View workflow job for this annotation

GitHub Actions / build

'whatAmI': local variable is initialized but not referenced [D:\a\Phobos\Phobos\Phobos.vcxproj]

if (pTypeExt->AutoDeath_Behavior.isset())
{
Expand All @@ -26,8 +26,7 @@
vec.erase(std::remove(vec.begin(), vec.end(), this), vec.end());
}

if (whatAmI != AbstractType::AircraftType && whatAmI != AbstractType::BuildingType
&& pType->Ammo > 0 && pTypeExt->ReloadInTransport)
if (pType->Ammo > 0 && pTypeExt->ReloadInTransport)
{
auto& vec = ScenarioExt::Global()->TransportReloaders;
vec.erase(std::remove(vec.begin(), vec.end(), this), vec.end());
Expand Down
8 changes: 2 additions & 6 deletions src/Ext/Techno/Hooks.Transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,14 @@
{
auto const pType = pPassenger->GetTechnoType();
auto const pExt = TechnoExt::ExtMap.Find(pPassenger);
auto const whatAmI = pPassenger->WhatAmI();

Check warning on line 76 in src/Ext/Techno/Hooks.Transport.cpp

View workflow job for this annotation

GitHub Actions / build

'whatAmI': local variable is initialized but not referenced [D:\a\Phobos\Phobos\Phobos.vcxproj]
auto const pTransTypeExt = TechnoExt::ExtMap.Find(pThis)->TypeExtData;

if (pTransTypeExt->Passengers_SyncOwner && pTransTypeExt->Passengers_SyncOwner_RevertOnExit)
pExt->OriginalPassengerOwner = pPassenger->Owner;

if (whatAmI != AbstractType::Aircraft && whatAmI != AbstractType::Building
&& pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport)
{
if (pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport)
ScenarioExt::Global()->TransportReloaders.push_back(pExt);
}
}

return 0;
Expand All @@ -98,12 +95,11 @@
{
auto const pType = pPassenger->GetTechnoType();
auto const pExt = TechnoExt::ExtMap.Find(pPassenger);
auto const whatAmI = pPassenger->WhatAmI();

Check warning on line 98 in src/Ext/Techno/Hooks.Transport.cpp

View workflow job for this annotation

GitHub Actions / build

'whatAmI': local variable is initialized but not referenced [D:\a\Phobos\Phobos\Phobos.vcxproj]
auto const pTransTypeExt = TechnoExt::ExtMap.Find(pThis)->TypeExtData;

// Remove from transport reloader list before switching house
if (whatAmI != AbstractType::Aircraft && whatAmI != AbstractType::Building
&& pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport)
if (pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport)
{
auto& vec = ScenarioExt::Global()->TransportReloaders;
vec.erase(std::remove(vec.begin(), vec.end(), pExt), vec.end());
Expand Down
4 changes: 2 additions & 2 deletions src/Ext/Techno/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,13 +796,13 @@ DEFINE_HOOK(0x5F4032, ObjectClass_FallingDown_ToDead, 0x6)

if (const auto pTechno = abstract_cast<TechnoClass*, true>(pThis))
{
const auto pType = pTechno->GetTechnoType();
const auto pTypeExt = TechnoExt::ExtMap.Find(pTechno)->TypeExtData;
const auto pType = pTypeExt->OwnerObject();
const auto pCell = pTechno->GetCell();

if (!pCell->IsClearToMove(pType->SpeedType, true, true, -1, pType->MovementZone, pCell->GetLevel(), pCell->ContainsBridge()))
return 0;

const auto pTypeExt = TechnoTypeExt::ExtMap.Find(pType);
double ratio = 0.0;

if (pCell->LandType == LandType::Water && !pTechno->OnBridge)
Expand Down
Loading