openmohaa/code/fgame/simpleentity.cpp

588 lines
12 KiB
C++
Raw Normal View History

2016-03-27 11:49:47 +02:00
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
OpenMoHAA source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// simpleentity.cpp : Simple entity
#include "glb_local.h"
#include "simpleentity.h"
#include "worldspawn.h"
2023-01-29 20:59:31 +01:00
#include "level.h"
#include "../script/scriptexception.h"
2016-03-27 11:49:47 +02:00
2023-08-09 20:57:17 +02:00
Event EV_SetTargetname
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"targetname",
EV_DEFAULT,
"s",
"targetName",
"set the targetname of the entity to targetName.",
EV_NORMAL
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_SetOrigin
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"origin",
EV_DEFAULT,
"v",
"newOrigin",
"Set the origin of the entity to newOrigin.",
EV_NORMAL
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_SetOrigin2
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"origin",
EV_DEFAULT,
"v",
"newOrigin",
"Set the origin of the entity to newOrigin.",
EV_SETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_GetOrigin
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"origin",
EV_DEFAULT,
NULL,
NULL,
"entity's origin",
EV_GETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_GetCentroid
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"centroid",
EV_DEFAULT,
NULL,
NULL,
"entity's centroid",
EV_GETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_SetTargetname2
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"targetname",
EV_DEFAULT,
"s",
"targetName",
"set the targetname of the entity to targetName.",
EV_SETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_GetTargetname
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"targetname",
EV_DEFAULT,
NULL,
NULL,
"entity's targetname",
EV_GETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_SetTarget
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"target",
EV_DEFAULT,
"s",
"targetname_to_target",
"target another entity with targetname_to_target.",
EV_NORMAL
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_SetTarget2
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"target",
EV_DEFAULT,
"s",
"targetname_to_target",
"target another entity with targetname_to_target.",
EV_SETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_GetTarget
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"target",
EV_DEFAULT,
NULL,
NULL,
"entity's target",
EV_GETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_SetAngles
2016-03-27 11:49:47 +02:00
(
2023-08-09 21:00:56 +02:00
"angles",
EV_DEFAULT,
"v[0,360][0,360][0,360]",
"newAngles",
"set the angles of the entity to newAngles.",
2023-08-09 20:57:17 +02:00
EV_NORMAL
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_SetAngles2
2016-03-27 11:49:47 +02:00
(
2023-08-09 21:00:56 +02:00
"angles",
EV_DEFAULT,
"v[0,360][0,360][0,360]",
"newAngles",
"set the angles of the entity to newAngles.",
2023-08-09 20:57:17 +02:00
EV_SETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_GetAngles
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"angles",
EV_DEFAULT,
NULL,
NULL,
"get the angles of the entity.",
EV_GETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_SetAngle
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"angle",
EV_DEFAULT,
"f",
"newAngle",
"set the angles of the entity using just one value.\n"
"Sets the yaw of the entity or an up and down\n"
"direction if newAngle is[ 0 - 359 ] or - 1 or - 2",
EV_NORMAL
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_SetAngle2
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"angle",
EV_DEFAULT,
"f",
"newAngle",
"set the angles of the entity using just one value.\n"
"Sets the yaw of the entity or an up and down\n"
"direction if newAngle is[ 0 - 359 ] or - 1 or - 2",
EV_SETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_GetAngle
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"angle",
EV_DEFAULT,
NULL,
NULL,
"get the angles of the entity using just one value.\n"
"Gets the yaw of the entity or an up and down\n"
"direction if newAngle is[ 0 - 359 ] or - 1 or - 2",
EV_GETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_ForwardVector
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"forwardvector",
EV_DEFAULT,
NULL,
NULL,
"get the forward vector of angles",
EV_GETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_LeftVector
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"leftvector",
EV_DEFAULT,
NULL,
NULL,
"get the left vector of angles",
EV_GETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_RightVector
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"rightvector",
EV_DEFAULT,
NULL,
NULL,
"get the right vector of angles",
EV_GETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
Event EV_UpVector
2016-03-27 11:49:47 +02:00
(
2023-08-09 20:57:17 +02:00
"upvector",
EV_DEFAULT,
NULL,
NULL,
"get the up vector of angles",
EV_GETTER
2016-03-27 11:49:47 +02:00
);
2023-08-09 20:57:17 +02:00
CLASS_DECLARATION(Listener, SimpleEntity, NULL) {
{&EV_SetOrigin, &SimpleEntity::SetOrigin },
{&EV_SetOrigin2, &SimpleEntity::SetOrigin },
{&EV_GetOrigin, &SimpleEntity::GetOrigin },
{&EV_GetCentroid, &SimpleEntity::GetCentroid },
{&EV_SetTargetname, &SimpleEntity::SetTargetname },
{&EV_SetTargetname2, &SimpleEntity::SetTargetname },
{&EV_GetTargetname, &SimpleEntity::GetTargetname },
{&EV_SetTarget, &SimpleEntity::SetTarget },
{&EV_SetTarget2, &SimpleEntity::SetTarget },
{&EV_GetTarget, &SimpleEntity::GetTarget },
{&EV_SetAngles, &SimpleEntity::SetAngles },
{&EV_SetAngles2, &SimpleEntity::SetAngles },
{&EV_GetAngles, &SimpleEntity::GetAngles },
{&EV_SetAngle, &SimpleEntity::SetAngleEvent },
{&EV_SetAngle2, &SimpleEntity::SetAngleEvent },
{&EV_GetAngle, &SimpleEntity::GetAngleEvent },
{&EV_ForwardVector, &SimpleEntity::GetForwardVector},
{&EV_LeftVector, &SimpleEntity::GetLeftVector },
{&EV_RightVector, &SimpleEntity::GetRightVector },
{&EV_UpVector, &SimpleEntity::GetUpVector },
{NULL, NULL }
};
2016-03-27 11:49:47 +02:00
2023-08-09 20:57:17 +02:00
SimpleEntity::SimpleEntity()
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
entflags = 0;
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
SimpleEntity::~SimpleEntity()
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
if (world) {
world->RemoveTargetEntity(this);
}
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfEntity(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_ENTITY);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfAnimate(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_ANIMATE);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfSentient(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_SENTIENT);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfPlayer(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_PLAYER);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfActor(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_ACTOR);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfItem(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_ITEM);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfInventoryItem(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_INVENTORYITEM);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfWeapon(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_WEAPON);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfProjectile(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_PROJECTILE);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfDoor(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_DOOR);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfCamera(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_CAMERA);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfVehicle(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_VEHICLE);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfVehicleTank(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_VEHICLETANK);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfVehicleTurretGun(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_VEHICLETURRET);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfTurretGun(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_TURRET);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfPathNode(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_PATHNODE);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfWaypoint(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_WAYPOINT);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfTempWaypoint(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_TEMPWAYPOINT);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfVehiclePoint(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_VEHICLEPOINT);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfSplinePath(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_SPLINEPATH);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfCrateObject(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_CRATEOBJECT);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
int SimpleEntity::IsSubclassOfBot(void) const
2016-03-27 11:49:47 +02:00
{
return (entflags & ECF_BOT);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::SetTargetName(str targetname)
2016-03-27 11:49:47 +02:00
{
if (!world) {
Com_Error(ERR_FATAL, "world spawn entity does not exist. Blame Galactus.");
}
2023-08-09 20:57:17 +02:00
world->RemoveTargetEntity(this);
2016-03-27 11:49:47 +02:00
2023-08-09 20:57:17 +02:00
this->targetname = targetname;
world->AddTargetEntity(this);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::SetTargetname(Event *ev)
2016-03-27 11:49:47 +02:00
{
if (this == world)
{
// not sure why this code is not directly handled by World
// as SetTargetName can be overridden
ScriptError("world was re-targeted with targetname '%s'", targetname.c_str());
}
2023-08-09 20:57:17 +02:00
SetTargetName(ev->GetString(1));
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::GetTargetname(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
ev->AddString(TargetName());
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::SetTarget(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
target = ev->GetString(1);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::GetTarget(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
ev->AddString(Target());
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::GetOrigin(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
ev->AddVector(origin);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::GetCentroid(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
ev->AddVector(centroid);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
str& SimpleEntity::Target()
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
return target;
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
qboolean SimpleEntity::Targeted(void)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
if (!targetname.length()) {
return false;
}
return true;
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
str& SimpleEntity::TargetName()
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
return targetname;
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::SetOrigin(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
setOriginEvent(ev->GetVector(1));
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::setOrigin(Vector origin)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
this->origin = origin;
this->centroid = origin;
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::setOriginEvent(Vector origin)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
setOrigin(origin);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::MPrintf(const char *fmt, ...)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
va_list argptr;
char msg[MAXPRINTMSG];
if (!*g_monitor->string) {
return;
}
if (targetname == g_monitor->string) {
va_start(argptr, fmt);
Q_vsnprintf(msg, sizeof(msg), fmt, argptr);
va_end(argptr);
Com_Printf("%s", msg);
}
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::SetAngles(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
Vector angles;
if (ev->NumArgs() == 1) {
angles = ev->GetVector(1);
} else {
angles = Vector(ev->GetFloat(1), ev->GetFloat(2), ev->GetFloat(3));
}
setAngles(angles);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::GetAngles(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
ev->AddVector(angles);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::SetAngleEvent(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
Vector dir;
float angle = ev->GetFloat(1);
dir = G_GetMovedir(angle);
2023-08-14 00:22:25 +02:00
setAngles(dir.toAngles());
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::GetAngleEvent(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
ev->AddFloat(angles[1]);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::setAngles(Vector angles)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
this->angles = angles.AnglesMod();
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::GetForwardVector(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
Vector fwd;
AngleVectorsLeft(angles, fwd, NULL, NULL);
ev->AddVector(fwd);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::GetLeftVector(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
Vector left;
AngleVectorsLeft(angles, NULL, left, NULL);
ev->AddVector(left);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::GetRightVector(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
Vector right;
AngleVectors(angles, NULL, right, NULL);
ev->AddVector(right);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::GetUpVector(Event *ev)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
Vector up;
AngleVectorsLeft(angles, NULL, NULL, up);
ev->AddVector(up);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
SimpleEntity *SimpleEntity::Next(void)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
SimpleEntity *ent = world->GetTarget(target, true);
if (!ent || !ent->isSubclassOf(SimpleEntity)) {
return NULL;
} else {
return ent;
}
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
void SimpleEntity::SimpleArchive(Archiver& arc)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
int index;
Listener::Archive(arc);
arc.ArchiveVector(&angles);
arc.ArchiveString(&target);
arc.ArchiveString(&targetname);
if (targetname.length()) {
if (arc.Loading()) {
arc.ArchiveInteger(&index);
world->AddTargetEntityAt(this, index);
} else {
index = world->GetTargetnameIndex(this);
arc.ArchiveInteger(&index);
}
}
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
CLASS_DECLARATION(SimpleEntity, SimpleArchivedEntity, NULL) {
{NULL, NULL}
2016-03-27 11:49:47 +02:00
};
2023-08-09 20:57:17 +02:00
void SimpleEntity::Archive(Archiver& arc)
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
SimpleEntity::SimpleArchive(arc);
arc.ArchiveVector(&origin);
arc.ArchiveVector(&centroid);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
SimpleArchivedEntity::SimpleArchivedEntity()
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
level.m_SimpleArchivedEntities.AddObject(this);
2016-03-27 11:49:47 +02:00
}
2023-08-09 20:57:17 +02:00
SimpleArchivedEntity::~SimpleArchivedEntity()
2016-03-27 11:49:47 +02:00
{
2023-08-09 20:57:17 +02:00
level.m_SimpleArchivedEntities.RemoveObject(this);
}