MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / Respawn

Method Respawn

src/SB/Game/zNPCTypeCommon.cpp:612–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610}
611
612S32 zNPCCommon::Respawn(const xVec3* pos, zMovePoint* mvptFirst, zMovePoint* mvptSpawnRef)
613{
614 static NPCMsg msg;
615
616 memset(&msg, 0, sizeof(msg));
617
618 msg.msgid = NPC_MID_RESPAWN;
619 msg.from = this->id;
620 msg.sendto = this->id;
621 msg.infotype = NPC_MDAT_SPAWN;
622
623 if (pos)
624 {
625 xVec3Copy(&msg.spawning.pos_spawn, pos);
626 }
627 else
628 {
629 xVec3Copy(&msg.spawning.pos_spawn, &this->entass->pos);
630 }
631
632 if (mvptFirst)
633 {
634 msg.spawning.nav_firstMovepoint = mvptFirst;
635 }
636 else
637 {
638 msg.spawning.nav_firstMovepoint = NULL;
639 }
640
641 msg.spawning.nav_spawnReference = mvptSpawnRef;
642 msg.spawning.spawnSuccess = 0;
643
644 zNPCMsg_SendMsg(&msg, this);
645
646 return msg.spawning.spawnSuccess;
647}
648
649S32 zNPCCommon::NPCMessage(NPCMsg* mail)
650{

Callers 1

SysEventMethod · 0.95

Calls 3

memsetFunction · 0.85
xVec3CopyFunction · 0.85
zNPCMsg_SendMsgFunction · 0.70

Tested by

no test coverage detected