本文整理汇总了C++中ShipRef::Relocate方法的典型用法代码示例。如果您正苦于以下问题:C++ ShipRef::Relocate方法的具体用法?C++ ShipRef::Relocate怎么用?C++ ShipRef::Relocate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShipRef
的用法示例。
在下文中一共展示了ShipRef::Relocate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Killed
void Client::Killed(Damage &fatal_blow) {
DynamicSystemEntity::Killed(fatal_blow);
if(GetShip()->typeID() == itemTypeCapsule) {
//we have been pod killed... off we go.
//TODO: destroy all implants
//TODO: send them back to their clone.
m_system->RemoveClient(this);
} else {
//our ship has been destroyed. Off to our capsule.
//We are currently not keeping our real capsule around in the DB, so we need to make a new one.
//m_system->bubbles.Remove(this, true);
std::string capsule_name = GetName();
capsule_name += "'s Capsule";
ItemData idata(
itemTypeCapsule,
GetCharacterID(),
GetLocationID(),
flagAutoFit,
capsule_name.c_str()
);
ShipRef capsule = m_services.item_factory.SpawnShip(idata);
if( !capsule ) {
codelog(CLIENT__ERROR, "Failed to create capsule for character '%s'", GetName());
//what to do?
return;
}
ShipRef dead_ship = GetShip(); //grab a ship ref to ensure that nobody else nukes it first.
//ok, nothing can fail now, we need have our capsule, make the transition.
//put the capsule where the ship was
capsule->Relocate(dead_ship->position());
//move it out of the way
dead_ship->Move(this->GetLocationID(), (EVEItemFlags)flagNone, true );
//this updates m_self and manages destiny updates as needed.
BoardShip((ShipRef)capsule);
mSession.SetInt("shipid", capsule->itemID() );
//This sends the RemoveBall for the old ship.
//kill off the old ship.
//TODO: figure out anybody else which may be referencing this ship...
dead_ship->Delete(); //remove from the DB.
}
}