|
@@ -125,11 +125,30 @@ void ActionTarget::toMessage(
|
|
|
{
|
|
{
|
|
|
if (zTarget->entityId >= 0)
|
|
if (zTarget->entityId >= 0)
|
|
|
{
|
|
{
|
|
|
- char* message = new char[6];
|
|
|
|
|
- message[0] = 3;
|
|
|
|
|
- message[1] = 1;
|
|
|
|
|
- *(int*)(message + 2) = zTarget->entityId;
|
|
|
|
|
- zMsg->setMessage(message, 6);
|
|
|
|
|
|
|
+ Entity* zEntity = Game::INSTANCE->zEntity(zTarget->entityId);
|
|
|
|
|
+ if (zEntity)
|
|
|
|
|
+ {
|
|
|
|
|
+ Framework::XML::Element* targetUIML = zEntity->getTargetUIML();
|
|
|
|
|
+ Framework::Text targetUIMLText
|
|
|
|
|
+ = targetUIML ? targetUIML->toString() : Framework::Text();
|
|
|
|
|
+ targetUIML->release();
|
|
|
|
|
+ char* message = new char[8 + targetUIMLText.getLength()];
|
|
|
|
|
+ message[0] = 3;
|
|
|
|
|
+ message[1] = 1;
|
|
|
|
|
+ *(int*)(message + 2) = zTarget->entityId;
|
|
|
|
|
+ *(short*)(message + 6) = (short)targetUIMLText.getLength();
|
|
|
|
|
+ memcpy(message + 8,
|
|
|
|
|
+ targetUIMLText.getText(),
|
|
|
|
|
+ targetUIMLText.getLength());
|
|
|
|
|
+ zMsg->setMessage(message, 8 + targetUIMLText.getLength());
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ char* message = new char[2];
|
|
|
|
|
+ message[0] = 3;
|
|
|
|
|
+ message[1] = 0;
|
|
|
|
|
+ zMsg->setMessage(message, 2);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -546,7 +565,7 @@ void Entity::calculateTarget(Framework::Vec3<float> basePos,
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
float distSq = Framework::Vec3<float>((float)px, (float)py, (float)pz)
|
|
float distSq = Framework::Vec3<float>((float)px, (float)py, (float)pz)
|
|
|
- .abstandSq(headPosition);
|
|
|
|
|
|
|
+ .abstandSq(headPosition);
|
|
|
Entity* zte = Game::INSTANCE->zDimension(dimensionId)
|
|
Entity* zte = Game::INSTANCE->zDimension(dimensionId)
|
|
|
->zTarget(headPosition, direction, distSq);
|
|
->zTarget(headPosition, direction, distSq);
|
|
|
if (zte)
|
|
if (zte)
|
|
@@ -750,6 +769,15 @@ void Entity::onFall(float collisionSpeed)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+Framework::XML::Element* Entity::getTargetUIML() const
|
|
|
|
|
+{
|
|
|
|
|
+ return new Framework::XML::Element(
|
|
|
|
|
+ Framework::Text(
|
|
|
|
|
+ "<targetInfo><text id=\"type\" width=\"auto\" height=\"auto\">")
|
|
|
|
|
+ + Game::INSTANCE->zEntityType(typeId)->getName()
|
|
|
|
|
+ + "</text></targetInfo>");
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
void Entity::setChatSecurityLevel(int level)
|
|
void Entity::setChatSecurityLevel(int level)
|
|
|
{
|
|
{
|
|
|
chatSecurityLevel = level;
|
|
chatSecurityLevel = level;
|