Skip to content

Commit

Permalink
feat: co-op support for sar_speedrun_triggers_info
Browse files Browse the repository at this point in the history
  • Loading branch information
p2r3 committed Jan 1, 2025
1 parent c0283c5 commit 86d787b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Features/Speedrun/Categories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "Event.hpp"
#include "Features/Demo/DemoGhostPlayer.hpp"
#include "Features/Hud/Hud.hpp"
#include "Modules/Client.hpp"
#include "Modules/Engine.hpp"
#include "Modules/Server.hpp"
#include "SpeedrunTimer.hpp"
Expand Down Expand Up @@ -122,11 +123,11 @@ static void dispatchRule(std::string name, SpeedrunRule *rule) {
int info = sar_speedrun_triggers_info.GetInt();
if (info == 0) return;

void *player = server->GetPlayer(1);
if (!player) return console->Print("Could not find player at slot 1.\n");
void *player = client->GetPlayer(GET_SLOT() + 1);
if (!player) return;

Vector pos = server->GetAbsOrigin(player);
Vector vel = server->GetLocalVelocity(player);
Vector pos = client->GetAbsOrigin(player);
Vector vel = client->GetLocalVelocity(player);

if (info == 1) {
// Info type 1 prints everything
Expand Down

0 comments on commit 86d787b

Please sign in to comment.