func_conveyor: Add Save/Restore methods for save-games.
This commit is contained in:
parent
6ca3900b4d
commit
3ca728e1d0
1 changed files with 26 additions and 1 deletions
|
@ -36,6 +36,8 @@ class func_conveyor:NSRenderableEntity
|
||||||
|
|
||||||
void(void) func_conveyor;
|
void(void) func_conveyor;
|
||||||
|
|
||||||
|
virtual void(float) Save;
|
||||||
|
virtual void(string,string) Restore;
|
||||||
virtual void(void) Respawn;
|
virtual void(void) Respawn;
|
||||||
virtual void(entity, int) Trigger;
|
virtual void(entity, int) Trigger;
|
||||||
virtual void(void) touch;
|
virtual void(void) touch;
|
||||||
|
@ -43,6 +45,29 @@ class func_conveyor:NSRenderableEntity
|
||||||
virtual void(entity, string, string) Input;
|
virtual void(entity, string, string) Input;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
func_conveyor::Save(float handle)
|
||||||
|
{
|
||||||
|
SaveFloat(handle, "m_flSpeed", m_flSpeed);
|
||||||
|
SaveVector(handle, "m_vecMoveDir", m_vecMoveDir);
|
||||||
|
super::Save(handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
func_conveyor::Restore(string strKey, string strValue)
|
||||||
|
{
|
||||||
|
switch (strKey) {
|
||||||
|
case "m_flSpeed":
|
||||||
|
m_flSpeed = ReadFloat(strValue);
|
||||||
|
break;
|
||||||
|
case "m_vecMoveDir":
|
||||||
|
m_vecMoveDir = ReadVector(strValue);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
super::Restore(strKey, strValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
func_conveyor::SetMovementDirection(void)
|
func_conveyor::SetMovementDirection(void)
|
||||||
{
|
{
|
||||||
|
@ -79,7 +104,7 @@ func_conveyor::Respawn(void)
|
||||||
SetMovementDirection();
|
SetMovementDirection();
|
||||||
SetModel(GetSpawnModel());
|
SetModel(GetSpawnModel());
|
||||||
SetMovetype(MOVETYPE_NONE);
|
SetMovetype(MOVETYPE_NONE);
|
||||||
SetSolid(SOLID_BSPTRIGGER);
|
SetSolid(SOLID_BSP);
|
||||||
|
|
||||||
/* TODO: Apply some effect flag the engine handles? */
|
/* TODO: Apply some effect flag the engine handles? */
|
||||||
if (!(spawnflags & SF_CONVEYOR_VISUAL)) {
|
if (!(spawnflags & SF_CONVEYOR_VISUAL)) {
|
||||||
|
|
Loading…
Reference in a new issue