Merge remote-tracking branch 'upstream/main' into PetFixes

This commit is contained in:
jadebenn
2024-04-19 18:30:43 -05:00
85 changed files with 4008 additions and 2891 deletions

View File

@@ -21,7 +21,7 @@ void WanderingVendor::OnProximityUpdate(Entity* self, Entity* entering, std::str
const auto proxObjs = proximityMonitorComponent->GetProximityObjects("playermonitor");
bool foundPlayer = false;
for (const auto id : proxObjs | std::views::keys) {
for (const auto id : proxObjs) {
auto* entity = Game::entityManager->GetEntity(id);
if (entity && entity->IsPlayer()) {
foundPlayer = true;

View File

@@ -17,7 +17,9 @@ void TokenConsoleServer::OnUse(Entity* self, Entity* user) {
inv->RemoveItem(6194, bricksToTake);
//play sound
GameMessages::SendPlayNDAudioEmitter(self, user->GetSystemAddress(), "947d0d52-c7f8-4516-8dee-e1593a7fd1d1");
if (self->HasVar(u"sound1")) {
GameMessages::SendPlayNDAudioEmitter(self, user->GetSystemAddress(), self->GetVarAsString(u"sound1"));
}
//figure out which faction the player belongs to:
auto character = user->GetCharacter();

View File

@@ -39,7 +39,7 @@ void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) {
const auto useSound = self->GetVar<std::string>(u"sound1");
if (!useSound.empty()) {
GameMessages::SendPlayNDAudioEmitter(self, UNASSIGNED_SYSTEM_ADDRESS, useSound);
GameMessages::SendPlayNDAudioEmitter(self, user->GetSystemAddress(), useSound);
}
// Player must be in faction to interact with this entity.

View File

@@ -23,13 +23,13 @@ void AgBusDoor::OnProximityUpdate(Entity* self, Entity* entering, std::string na
m_Counter = 0;
m_OuterCounter = 0;
for (const auto& pair : proximityMonitorComponent->GetProximityObjects("busDoor")) {
auto* entity = Game::entityManager->GetEntity(pair.first);
for (const auto id : proximityMonitorComponent->GetProximityObjects("busDoor")) {
const auto* const entity = Game::entityManager->GetEntity(id);
if (entity != nullptr && entity->IsPlayer()) m_Counter++;
}
for (const auto& pair : proximityMonitorComponent->GetProximityObjects("busDoorOuter")) {
auto* entity = Game::entityManager->GetEntity(pair.first);
for (const auto id : proximityMonitorComponent->GetProximityObjects("busDoorOuter")) {
const auto* const entity = Game::entityManager->GetEntity(id);
if (entity != nullptr && entity->IsPlayer()) m_OuterCounter++;
}