Working on server side stuff

This commit is contained in:
Vladislav Khorev committed 2026-11-17 15:28:21 +06:00
1 parent a784da9fb4
commit 542fc191fa
12 files changed
+757 -64

No files matched your search

+4 -5
View File
@@ -2072,7 +2072,6 @@ namespace FRG
: Vec3fp::fromEigen(clickedObject->state.position);
setCharacterTarget(*player, interactionTarget);
pathVisualization.start(*player, interactionTarget.toEigen());
clearCharacterAttackTarget(*player);
//logger() << "[CLICK] Player moving to object..." << std::endl;
}
else {
@@ -2104,8 +2103,6 @@ namespace FRG
tryCharacterAttackCombo(*player);
}
const std::string targetId = clickedNpc->entityId();
gameServer_.submit(SetCharacterTargetCommand{
locationId_, player->entityId(), targetId});
gameServer_.submit(SetLocationTargetsCommand{
locationId_, std::string(), std::string(), std::string()});
@@ -2116,6 +2113,10 @@ namespace FRG
clickedNpcState->position.toEigen(),
PathVisualization::Style::Hostile);
}
// Must follow any destination: in lockstep the last order of
// a frame wins, and attacking must supersede the walk.
gameServer_.submit(SetCharacterTargetCommand{
locationId_, player->entityId(), targetId});
if (distance <= static_cast<float>(clickedNpcState->interactionRadius)) {
//logger() << "[CLICK] Hostile NPC " << npcIndex << " in range; firing on_npc_interact" << std::endl;
@@ -2173,12 +2174,10 @@ namespace FRG
*player,
clickedTeleport->position,
PathVisualization::Style::Teleport);
clearCharacterAttackTarget(*player);
} else {
const Eigen::Vector3f clickedDestination(hit.x(), 0.f, hit.z());
setCharacterTarget(*player, Vec3fp::fromEigen(clickedDestination));
pathVisualization.start(*player, clickedDestination);
clearCharacterAttackTarget(*player);
gameServer_.submit(SetLocationTargetsCommand{
locationId_, std::string(), std::string(), std::string()});
if (onPlayerFloorWalk) onPlayerFloorWalk();