本文整理汇总了C++中CreatureObject::isInvisible方法的典型用法代码示例。如果您正苦于以下问题:C++ CreatureObject::isInvisible方法的具体用法?C++ CreatureObject::isInvisible怎么用?C++ CreatureObject::isInvisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreatureObject
的用法示例。
在下文中一共展示了CreatureObject::isInvisible方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getPlayersInRange
int LuaSceneObject::getPlayersInRange(lua_State *L) {
int range = lua_tonumber(L, -1);
Zone* thisZone = realObject->getZone();
if (thisZone == NULL) {
lua_pushnil(L);
return 1;
}
lua_newtable(L);
Reference<SortedVector<ManagedReference<QuadTreeEntry*> >*> closeObjects = new SortedVector<ManagedReference<QuadTreeEntry*> >();
thisZone->getInRangeObjects(realObject->getWorldPositionX(), realObject->getWorldPositionY(), range, closeObjects, true);
int numPlayers = 0;
for (int i = 0; i < closeObjects->size(); ++i) {
SceneObject* object = cast<SceneObject*>(closeObjects->get(i).get());
if (object == NULL || !object->isPlayerCreature())
continue;
CreatureObject* player = object->asCreatureObject();
if (player == NULL || player->isInvisible())
continue;
numPlayers++;
lua_pushlightuserdata(L, object);
lua_rawseti(L, -2, numPlayers);
}
return 1;
}
示例2: notifyEnter
void SpawnAreaImplementation::notifyEnter(SceneObject* object) {
if (!(tier & SpawnAreaMap::SPAWNAREA)) {
ActiveAreaImplementation::notifyEnter(object);
return;
}
if (!object->isPlayerCreature())
return;
CreatureObject* creo = cast<CreatureObject*>(object);
if (creo->isInvisible()) {
return;
}
ManagedReference<SceneObject*> parent = object->getParent();
if (parent != NULL && parent->isCellObject())
return;
if (object->getCityRegion() != NULL)
return;
ManagedReference<SpawnArea*> spawnArea = _this.getReferenceUnsafeStaticCast();
ManagedReference<SceneObject*> obj = object;
EXECUTE_TASK_2(spawnArea, obj, {
spawnArea_p->tryToSpawn(obj_p);
});
示例3: notifyInsert
void PlayerZoneComponent::notifyInsert(SceneObject* sceneObject, QuadTreeEntry* entry) {
SceneObject* scno = cast<SceneObject*>( entry);
if (scno == NULL || scno == sceneObject)
return;
if (scno->isPlayerCreature()) {
CreatureObject* player = cast<CreatureObject*>( scno);
if (player->isInvisible())
return;
}
ManagedReference<SceneObject*> parent = scno->getParent().get();
if (parent != NULL /*&& parent->isCellObject()*/) {
return;
}
scno->sendTo(sceneObject, true);
}
示例4: updateZoneWithParent
void ZoneComponent::updateZoneWithParent(SceneObject* sceneObject, SceneObject* newParent, bool lightUpdate, bool sendPackets) {
ManagedReference<Zone*> zone = sceneObject->getZone();
ManagedReference<SceneObject*> oldParent = sceneObject->getParent();
if (oldParent != NULL && !oldParent->isCellObject())
return;
if (zone == NULL)
zone = newParent->getRootParent().get()->getZone();
Locker _locker(zone);
if (oldParent == NULL) { // we are in zone, enter cell
//zone->remove(sceneObject);
newParent->transferObject(sceneObject, -1, true);
zone->unlock();
//insertToBuilding(sceneObject, dynamic_cast<BuildingObject*>(newParent->getParent()));
} else { // we are in cell already
if (oldParent != newParent) {
//oldParent->removeObject(sceneObject, false);
newParent->transferObject(sceneObject, -1, true);
zone->unlock();
} else {
zone->unlock();
zone->updateActiveAreas(sceneObject);
}
//notify in range objects that i moved
}
CloseObjectsVector* closeObjects = (CloseObjectsVector*) sceneObject->getCloseObjects();
if (closeObjects != NULL) {
SortedVector<ManagedReference<QuadTreeEntry*> > objects(closeObjects->size(), 10);
closeObjects->safeCopyTo(objects);
for (int i = 0; i < objects.size(); ++i) {
QuadTreeEntry* object = objects.get(i);
try {
object->notifyPositionUpdate(sceneObject);
} catch (Exception& e) {
}
}
}
//zoneLocker.release();
//zone->unlock();
bool isInvis = false;
if (sceneObject->isCreatureObject()) {
CreatureObject* creo = cast<CreatureObject*>(sceneObject);
if(creo->isInvisible())
isInvis = true;
}
if (sendPackets && !isInvis) {
if (lightUpdate) {
LightUpdateTransformWithParentMessage* message = new LightUpdateTransformWithParentMessage(sceneObject);
sceneObject->broadcastMessage(message, false, true);
} else {
UpdateTransformWithParentMessage* message = new UpdateTransformWithParentMessage(sceneObject);
sceneObject->broadcastMessage(message, false, true);
}
}
try {
notifySelfPositionUpdate(sceneObject);
} catch (Exception& e) {
sceneObject->error("Exception caught while calling notifySelfPositionUpdate(sceneObject) in ZoneComponent::updateZoneWithParent");
sceneObject->error(e.getMessage());
}
zone->wlock();
}
示例5: updateZone
void ZoneComponent::updateZone(SceneObject* sceneObject, bool lightUpdate, bool sendPackets) {
ManagedReference<SceneObject*> parent = sceneObject->getParent();
Zone* zone = sceneObject->getZone();
ManagedReference<SceneObject*> sceneObjectRootParent = sceneObject->getRootParent();
if (zone == NULL) {
if (sceneObjectRootParent == NULL)
return;
zone = sceneObjectRootParent->getZone();
}
if (parent != NULL && (parent->isVehicleObject() || parent->isMount()))
sceneObject->updateVehiclePosition(sendPackets);
Locker _locker(zone);
bool zoneUnlocked = false;
if (parent != NULL && parent->isCellObject()) {
//parent->removeObject(sceneObject, true);
//removeFromBuilding(sceneObject, dynamic_cast<BuildingObject*>(parent->getParent()));
zone = parent->getRootParent().get()->getZone();
zone->transferObject(sceneObject, -1, false);
zone->unlock();
} else {
if (sceneObject->getLocalZone() != NULL) {
zone->update(sceneObject);
zone->unlock();
zone->inRange(sceneObject, 192);
} else if (parent != NULL) {
zone->unlock();
updateInRangeObjectsOnMount(sceneObject);
}
}
zone->updateActiveAreas(sceneObject);
bool isInvis = false;
if (sceneObject->isCreatureObject()) {
CreatureObject* creo = cast<CreatureObject*>(sceneObject);
if(creo->isInvisible())
isInvis = true;
}
if (!isInvis && sendPackets && (parent == NULL || (!parent->isVehicleObject() && !parent->isMount()))) {
if (lightUpdate) {
LightUpdateTransformMessage* message = new LightUpdateTransformMessage(sceneObject);
sceneObject->broadcastMessage(message, false, true);
} else {
UpdateTransformMessage* message = new UpdateTransformMessage(sceneObject);
sceneObject->broadcastMessage(message, false, true);
}
}
try {
notifySelfPositionUpdate(sceneObject);
} catch (Exception& e) {
sceneObject->error("Exception caught while calling notifySelfPositionUpdate(sceneObject) in ZoneComponent::updateZone");
sceneObject->error(e.getMessage());
}
zone->wlock();
}