mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-14 00:01:30 -04:00
54 lines
1.7 KiB
C++
Executable File
54 lines
1.7 KiB
C++
Executable File
// ======================================================================
|
|
//
|
|
// ServerCollisionProperty.cpp
|
|
//
|
|
// Copyright 2001 Sony Online Entertainment
|
|
//
|
|
// ======================================================================
|
|
|
|
#include "serverGame/FirstServerGame.h"
|
|
#include "serverGame/ServerCollisionProperty.h"
|
|
|
|
#include "serverGame/CreatureObject.h"
|
|
|
|
// ======================================================================
|
|
|
|
ServerCollisionProperty::ServerCollisionProperty(ServerObject &owner) :
|
|
CollisionProperty(owner)
|
|
{
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
ServerCollisionProperty::ServerCollisionProperty(ServerObject &owner, SharedObjectTemplate const *objTemplate) :
|
|
CollisionProperty(owner, objTemplate)
|
|
{
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
bool ServerCollisionProperty::canCollideWith (CollisionProperty const *otherCollision) const
|
|
{
|
|
if (!otherCollision)
|
|
return false;
|
|
|
|
if (isMobile() && otherCollision->isMobile())
|
|
{
|
|
ServerObject const * const ownerServerObject = getOwner().asServerObject();
|
|
ServerObject const * const otherOwnerServerObject = otherCollision->getOwner().asServerObject();
|
|
|
|
CreatureObject const * const ownerA = (ownerServerObject != 0) ? ownerServerObject->asCreatureObject() : 0;
|
|
CreatureObject const * const ownerB = (otherOwnerServerObject != 0) ? otherOwnerServerObject->asCreatureObject() : 0;
|
|
|
|
if (ownerA && (ownerA->isDead() || ownerA->isIncapacitated()))
|
|
return false;
|
|
if (ownerB && (ownerB->isDead() || ownerB->isIncapacitated()))
|
|
return false;
|
|
}
|
|
|
|
return CollisionProperty::canCollideWith(otherCollision);
|
|
}
|
|
|
|
// ======================================================================
|
|
|