Fixing bugs
This commit is contained in:
1 parent
0240721d46
commit
570f051281
5 files changed
+49
-9
No files matched your search
@@ -2059,6 +2059,16 @@ namespace FRG
|
||||
player->state.attackTargetIndex = npcIndex;
|
||||
state.targetInteractNpcIndex = -1;
|
||||
|
||||
if (distance >= Character::kAttackRange) {
|
||||
player->setTarget(clickedNpc->state.position);
|
||||
if (!player->state.pathWaypoints.empty()) {
|
||||
pathVisualization.start(
|
||||
*player,
|
||||
clickedNpc->state.position,
|
||||
PathVisualization::Style::Hostile);
|
||||
}
|
||||
}
|
||||
|
||||
if (distance <= clickedNpc->state.interactionRadius) {
|
||||
//logger() << "[CLICK] Hostile NPC " << npcIndex << " in range; firing on_npc_interact" << std::endl;
|
||||
scriptEngine.callNpcInteractCallback(npcIndex);
|
||||
@@ -2080,6 +2090,9 @@ namespace FRG
|
||||
//logger() << "[CLICK] NPC " << npcIndex << " out of talk range (distance " << distance
|
||||
// << " > " << NPC_TALK_DISTANCE << "); walking to NPC..." << std::endl;
|
||||
player->setTarget(clickedNpc->state.position);
|
||||
if (!player->state.pathWaypoints.empty()) {
|
||||
pathVisualization.start(*player, clickedNpc->state.position);
|
||||
}
|
||||
state.targetInteractNpcIndex = npcIndex;
|
||||
}
|
||||
}
|
||||
@@ -2105,6 +2118,12 @@ namespace FRG
|
||||
state.targetInteractiveObjectIndex = -1;
|
||||
state.targetInteractNpcIndex = -1;
|
||||
player->setTarget(clickedTeleport->position);
|
||||
if (!player->state.pathWaypoints.empty()) {
|
||||
pathVisualization.start(
|
||||
*player,
|
||||
clickedTeleport->position,
|
||||
PathVisualization::Style::Teleport);
|
||||
}
|
||||
player->state.attackTargetIndex = CharacterState::kNoTarget;
|
||||
} else {
|
||||
const Eigen::Vector3f clickedDestination(hit.x(), 0.f, hit.z());
|
||||
|
||||
Reference in new issue
Block a user