MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / insertRoutine

Method insertRoutine

src/logic/NpcScriptState.cpp:391–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391void NpcScriptState::insertRoutine(int hoursStart, int minutesStart, int hoursEnd, int minutesEnd, size_t symFunc,
392 const std::string& waypoint)
393{
394 // FIXME: HACK, let the npc teleport to the first entry of the routine
395 if (!m_Routine.hasRoutine)
396 {
397 VobTypes::NpcVobInformation npc = VobTypes::asNpcVob(m_World, m_HostVob);
398
399 World::Waynet::WaypointIndex wp = World::Waynet::getWaypointIndex(m_World.getWaynet(), waypoint);
400
401 if (wp != World::Waynet::INVALID_WAYPOINT)
402 npc.playerController->teleportToWaypoint(wp);
403 }
404
405 m_Routine.hasRoutine = true; // At least one routine-target present
406
407 // Make new routine entry
408 RoutineEntry entry;
409 entry.hoursStart = hoursStart;
410 entry.hoursEnd = hoursEnd;
411 entry.minutesStart = minutesStart;
412 entry.minutesEnd = minutesEnd;
413 entry.symFunc = symFunc;
414 entry.waypoint = waypoint;
415 entry.isOverlay = false;
416
417 m_Routine.routine.push_back(entry);
418}
419
420bool NpcScriptState::isNpcStateDriven()
421{

Callers 1

Calls 3

getWaypointIndexFunction · 0.85
teleportToWaypointMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected