当前位置: 首页>>代码示例>>C++>>正文


C++ ShipRef::Relocate方法代码示例

本文整理汇总了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.
		

	}
}
开发者ID:Almamu,项目名称:evemu_incursion,代码行数:63,代码来源:Damage.cpp


注:本文中的ShipRef::Relocate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。