mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-29 06:07:57 +03:00
Implemented ClientGameCommandManager::BeginTagSpawnLinked
This commit is contained in:
parent
3e657679a0
commit
403e98fba6
1 changed files with 33 additions and 1 deletions
|
@ -2979,7 +2979,39 @@ void ClientGameCommandManager::GetOrientation(int tagnum, spawnthing_t *sp)
|
||||||
AxisCopy(sp->axis, sp->tag_axis);
|
AxisCopy(sp->axis, sp->tag_axis);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientGameCommandManager::BeginTagSpawnLinked(Event *ev) {}
|
//===============
|
||||||
|
// BeginTagSpawnLinked
|
||||||
|
//===============
|
||||||
|
void ClientGameCommandManager::BeginTagSpawnLinked(Event *ev) {
|
||||||
|
str tagname;
|
||||||
|
int tagnum;
|
||||||
|
int i;
|
||||||
|
orientation_t ori;
|
||||||
|
|
||||||
|
// Get the tagname and orientation
|
||||||
|
tagname = ev->GetString(1);
|
||||||
|
tagnum = cgi.Tag_NumForName(current_tiki, tagname.c_str());
|
||||||
|
if (tagnum == -1) {
|
||||||
|
throw ScriptException("Tagname '%s' does not exist", tagname.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup ending function
|
||||||
|
endblockfcn = &ClientGameCommandManager::EndTagSpawn;
|
||||||
|
|
||||||
|
// Create a new emitter
|
||||||
|
m_spawnthing = CreateNewEmitter();
|
||||||
|
m_spawnthing->entnum = current_entity->entityNumber;
|
||||||
|
m_spawnthing->cgd.tiki = current_tiki;
|
||||||
|
m_spawnthing->cgd.flags = T_WAVE;
|
||||||
|
m_spawnthing->cgd.origin = Vector(0, 0, 0);
|
||||||
|
VectorCopy(current_entity->origin, m_spawnthing->linked_origin);
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++) {
|
||||||
|
VectorMA(m_spawnthing->linked_origin, ori.origin[i], current_entity->axis[i], m_spawnthing->linked_origin);
|
||||||
|
}
|
||||||
|
|
||||||
|
MatrixMultiply(ori.axis, current_entity->axis, m_spawnthing->linked_axis);
|
||||||
|
}
|
||||||
|
|
||||||
//===============
|
//===============
|
||||||
// BeginTagSpawn
|
// BeginTagSpawn
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue