MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / SwitchScene

Method SwitchScene

src/plugin/kernel/src/AFCEntity.cpp:212–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212bool AFCEntity::SwitchScene(const int32_t map_id, const int32_t map_inst_id, const AFVector3D& pos)
213{
214 ARK_ASSERT_RET_VAL(m_pCallBackManager != nullptr && opt_charactor_ != nullptr, false);
215
216 if (opt_charactor_->map_id_ == map_id && opt_charactor_->map_entity_id_ == map_inst_id)
217 {
218 return false;
219 }
220
221 m_pCallBackManager->OnLeaveSceneEvent(guid_, opt_charactor_->map_id_, opt_charactor_->map_entity_id_);
222
223 opt_charactor_->map_id_ = map_id;
224 opt_charactor_->map_entity_id_ = map_inst_id;
225 opt_charactor_->pos_ = pos;
226
227 m_pCallBackManager->OnEnterSceneEvent(guid_, opt_charactor_->map_id_, opt_charactor_->map_entity_id_);
228
229 return true;
230}
231
232const AFVector3D& AFCEntity::GetPosition() const
233{

Callers 1

SwitchMapMethod · 0.80

Calls 2

OnLeaveSceneEventMethod · 0.80
OnEnterSceneEventMethod · 0.80

Tested by

no test coverage detected