本文整理汇总了C++中game_import_t::AddCommandString方法的典型用法代码示例。如果您正苦于以下问题:C++ game_import_t::AddCommandString方法的具体用法?C++ game_import_t::AddCommandString怎么用?C++ game_import_t::AddCommandString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game_import_t
的用法示例。
在下文中一共展示了game_import_t::AddCommandString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExitLevel
/*
=============
ExitLevel
=============
*/
void ExitLevel(void){
int i;
edict_t *ent;
char command [256];
level.exitintermission = 0;
level.intermissiontime = 0;
if(CTFNextMap())
return;
Com_sprintf(command, sizeof(command), "gamemap \"%s\"\n", level.changemap);
gi.AddCommandString(command);
ClientEndServerFrames();
level.changemap = NULL;
// clear some things before going to next level
for(i = 0; i < maxclients->value; i++){
ent = g_edicts + 1 + i;
if(!ent->inuse)
continue;
if(ent->health > ent->client->pers.max_health)
ent->health = ent->client->pers.max_health;
}
}
示例2: ExitLevel
/*
=============
ExitLevel
=============
*/
void ExitLevel(void)
{
char command[256];
Com_sprintf(command, sizeof(command), "gamemap \"%s\"\n", level.changemap);
gi.AddCommandString(command);
level.changemap = NULL;
level.exitintermission = 0;
level.intermissiontime = 0;
ClientEndServerFrames();
// clear some things before going to next level
for (int i = 0; i < maxclients->value; i++)
{
edict_t *ent = g_edicts + 1 + i;
if (ent->inuse)
ent->health = min(ent->client->pers.max_health, ent->health);
}
//mxd. https://github.com/yquake2/xatrix/commit/291d9852ee54284127b046807f6dac9418e19dc6
gibsthisframe = 0;
lastgibframe = 0;
}