File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Server/Components/NPCs/NPC Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2280,7 +2280,10 @@ void NPC::advance(TimePoint now)
22802280 if (distanceToTarget <= stopRange_ || maxTravel >= distanceToTarget)
22812281 {
22822282 // Reached or about to overshoot target
2283- auto targetPos = targetPosition_; // just copy this to use in setPosition, since stopMove resets it
2283+ // UPDATE: Since we have stopRange now, let's set NPC's position as where it is now, after reaching.
2284+ // As in, let's just use position, instead of targetPosition.
2285+ auto finalPos = position;
2286+ // auto finalPos = targetPosition_; // just copy this to use in setPosition, since stopMove resets it
22842287
22852288 // If following a player, check autoRestart setting
22862289 bool wasFollowingPlayer = followingPlayer_ != nullptr ;
@@ -2304,7 +2307,7 @@ void NPC::advance(TimePoint now)
23042307 removeKey (Key::WALK);
23052308 }
23062309
2307- setPosition (targetPos , false );
2310+ setPosition (finalPos , false );
23082311
23092312 // Check if the movement was triggered for entering a vehicle
23102313 float distanceToVehicle = 0 .0f ;
You can’t perform that action at this time.
0 commit comments