Main game functions. More...
#include "g_local.h"
#include "g_ai.h"
Go to the source code of this file.
Main game functions.
Definition in file g_main.c.
static void CheckNeedPass | ( | void | ) | [static] |
If password has changed, update sv_needpass cvar as needed.
Definition at line 377 of file g_main.c.
References game_import_t::Cvar_Set(), cvar_s::modified, Q_strcasecmp, qfalse, and cvar_s::string.
Referenced by G_RunFrame().
void Com_DPrintf | ( | int | level, | |
const char * | msg, | |||
... | ||||
) |
Definition at line 354 of file g_main.c.
References cvar_s::integer, and Q_vsnprintf().
void Com_Printf | ( | const char * | msg, | |
... | ||||
) |
Definition at line 342 of file g_main.c.
References Q_vsnprintf().
static void* G_AllocInventoryMemory | ( | size_t | size | ) | [static] |
Definition at line 127 of file g_main.c.
References G_TagMalloc, and TAG_INVENTORY.
static void G_FreeAllInventory | ( | void | ) | [static] |
Definition at line 132 of file g_main.c.
References G_FreeTags, and TAG_INVENTORY.
Referenced by G_Shutdown().
static void G_FreeInventory | ( | void * | data | ) | [static] |
static void G_Init | ( | void | ) | [static] |
This will be called when the game library is first loaded.
Definition at line 144 of file g_main.c.
References AIL_Init(), game_import_t::csi, CVAR_ARCHIVE, CVAR_CHEAT, CVAR_DEVELOPER, game_import_t::Cvar_Get(), CVAR_LATCH, CVAR_NOSET, CVAR_SERVERINFO, CVAR_USERINFO, game_export_t::edicts, game_import_t::FS_Gamedir(), G_EdictsInit(), G_TagMalloc, GAMEVERSION, game_locals_t::i, cvar_s::integer, INV_InitInventory(), INVSH_InitCSI(), logstatsfile, game_export_t::max_edicts, game_export_t::maxplayersperteam, cvar_s::modified, game_export_t::num_edicts, game_export_t::players, game_locals_t::players, qfalse, game_locals_t::sv_maxentities, game_locals_t::sv_maxplayersperteam, TAG_GAME, and va().
Referenced by GetGameAPI().
qboolean G_RunFrame | ( | void | ) |
Definition at line 405 of file g_main.c.
References AI_Run(), CheckNeedPass(), CS_MAXTEAMS, game_import_t::Cvar_Set(), level_locals_t::framenum, G_CheckForceEndRound(), G_CompleteRecalcRouting(), G_MatchDoEnd(), G_MatchIsRunning(), G_PhysicsRun(), G_SendBoundingBoxes(), cvar_s::integer, cvar_s::modified, qfalse, qtrue, level_locals_t::roundstartTime, level_locals_t::routed, SERVER_FRAME_SECONDS, and level_locals_t::time.
Referenced by GetGameAPI().
static void G_SendBoundingBoxes | ( | void | ) | [static] |
Definition at line 390 of file g_main.c.
References G_EdictsGetFirst(), G_EdictsGetNextInUse(), G_EventSendEdict(), and cvar_s::integer.
Referenced by G_RunFrame().
static void G_Shutdown | ( | void | ) | [static] |
Free the tags TAG_LEVEL and TAG_GAME.
Definition at line 271 of file g_main.c.
References AIL_Shutdown(), Com_Printf(), G_FreeAllInventory(), G_FreeTags, inventoryInterface_s::GetUsedSlots, game_locals_t::i, logstatsfile, TAG_GAME, and TAG_LEVEL.
Referenced by GetGameAPI().
game_export_t* GetGameAPI | ( | game_import_t * | import | ) |
Returns a pointer to the structure with all entry points and global variables.
Definition at line 292 of file g_main.c.
References game_export_t::apiversion, game_export_t::ClientGetName(), game_export_t::edict_size, G_ClientAction(), G_ClientBegin(), G_ClientCommand(), G_ClientConnect(), G_ClientDisconnect(), G_ClientEndRound(), G_ClientGetTeamNum(), G_ClientGetTeamNumPref(), G_ClientInitActorStates(), G_ClientIsReady(), G_ClientSpawn(), G_ClientTeamInfo(), G_ClientUserinfoChanged(), G_GetActiveTeam(), G_GetPlayerName(), G_Init(), G_RunFrame(), G_ServerCommand(), G_Shutdown(), G_SpawnEntities(), GAME_API_VERSION, game_export_t::player_size, and game_import_t::seed.
Referenced by SV_GetGameAPI().
void Sys_Error | ( | const char * | error, | |
... | ||||
) |
Definition at line 330 of file g_main.c.
References Q_vsnprintf().
Referenced by _Mem_Alloc(), _Mem_CheckPoolIntegrity(), _Mem_CheckSentinels(), _Mem_CreatePool(), _Mem_ReAlloc(), AddBrushBevels(), AddPortalToNodes(), AddScriptToStack(), AII_UpdateOneInstallationDelay(), AIR_ParseAircraft(), AL_AddAliens(), AL_RemoveAliens(), ASE_GetCurrentMesh(), ASE_KeyGEOMOBJECT(), ASE_KeyMATERIAL_LIST(), ASE_KeyMESH(), ASE_KeyMESH_FACE_LIST(), ASE_KeyMESH_TVERTLIST(), ASE_KeyMESH_VERTEX_LIST(), ASE_KeyTFACE_LIST(), ASE_Load(), ASE_ParseBracedBlock(), ASE_Process(), ASE_SkipEnclosingBraces(), BaseWindingForPlane(), BeginModel(), CalcLightinfoExtents(), CalcLightinfoVectors(), Check_ExtraBrushesForWorldspawn(), Check_FindCompositeSides(), Check_InfoStartAligned(), Check_InitEntityDefs(), Check_NearList(), CheckFlags(), CheckPlaneAgainstParents(), ChopWindingInPlace(), CHRSH_CharGenAbilitySkills(), CHRSH_CharGetBody(), CHRSH_CharGetHead(), CL_ParseCampaignEvents(), CL_ParseMapDefinition(), ClipWindingEpsilon(), Com_AddObjectLinks(), Com_AlignPtr(), Com_AllocateCustomSkin(), Com_EParseValue(), Com_Error(), Com_GiveName(), Com_ParseActorModels(), Com_ParseActorNames(), Com_ParseArmourOrResistance(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseGameTypes(), Com_ParseInventory(), Com_ParseItem(), Com_ParseScripts(), Com_ParseTeam(), Com_ParseValue(), Com_ParseVersion(), Com_SetValue(), Com_ValueToStr(), CopyLump(), CP_GetEventsByID(), CP_MissionChooseUFO(), CreateNewFloatPlane(), EmitBrushes(), EmitDrawNode_r(), EmitFace(), EmitFaceVertexes(), EmitLeaf(), EndOfScript(), FacesWithVert(), FinalLightFace(), FindMiptex(), FIRESH_GetFiredef(), FixWorkingDirectory(), FreeWinding(), FS_CopyFile(), FS_OpenFileSingle(), FS_Read(), FS_RemoveFile(), FS_RenameFile(), FS_RestartFilesystem(), FS_Seek(), GatherSampleLight(), GetEdge(), GetToken(), GetVertexnum(), HashVec(), I_EquipActorMelee(), I_MoveInInventory(), InitCocoa(), INV_GetFilterFromItem(), INVSH_CheckToInventory_shape(), INVSH_GetItemByIDX(), INVSH_SearchInInventory(), Key_GetBinding(), LightWorld(), LoadBSPFile(), LoadJPG(), LoadPNG(), LoadTGA(), main(), MakeNodePortal(), MoveBrushesToWorld(), MSO_InitList(), ParseBrush(), ParseEntity(), ParseEpair(), ParseFromMemory(), ParseMapEntity(), PlaneFromPoints(), PQueueInitialise(), ProcessSubModel(), PruneNodes_r(), Q_strcat(), Q_strncpyz(), Qcommon_Init(), RemovePortalFromNode(), RT_WriteCSVFiles(), SelectSplitSide(), SplitNodePortals(), SubdivideFace(), Sys_FindFirst(), Sys_Init(), TestBrushToPlanenum(), TestEdge(), TexinfoForBrushTexture(), ThreadInit(), ThreadLock(), ThreadUnlock(), TR_BuildTracingNode_r(), U2M_Parameter(), UI_BaseMapNodeRightClick(), UI_CheckActionTokenTypeSanity(), UI_DrawModelNodeWithUIModel(), UI_EditorNodeCapturedMouseMove(), UI_GetReferenceFloat(), UI_GetReferenceString(), UI_ParseWindow(), WriteBSPBrushMap(), WriteBSPFile(), WriteMapFile(), and WriteTGA24().
Definition at line 70 of file g_main.c.
Referenced by AI_CreatePlayer(), G_SpawnEntities(), and SP_alien_start().
Definition at line 68 of file g_main.c.
Referenced by AI_CreatePlayer().
Definition at line 69 of file g_main.c.
Referenced by AI_CreatePlayer(), and SP_civilian_start().
Definition at line 118 of file g_main.c.
Referenced by G_Damage().
Definition at line 114 of file g_main.c.
Referenced by G_CheckFlood().
Definition at line 115 of file g_main.c.
Referenced by G_CheckFlood().
Definition at line 116 of file g_main.c.
Referenced by G_CheckFlood().
Definition at line 113 of file g_main.c.
Referenced by G_ClientMove().
Definition at line 108 of file g_main.c.
Referenced by G_TestVis().
Definition at line 109 of file g_main.c.
Referenced by G_TraceDraw().
Definition at line 110 of file g_main.c.
Referenced by G_Damage().
Definition at line 112 of file g_main.c.
Referenced by G_SetTeamForPlayer().
Definition at line 111 of file g_main.c.
Referenced by G_ClientMove().
Definition at line 106 of file g_main.c.
Referenced by G_ReactionFireCheckExecution().
Definition at line 32 of file g_main.c.
Referenced by AI_CreatePlayer(), AI_Run(), AI_SetEquipment(), G_ActorInvMove(), G_AddItemToFloor(), G_CheckForceEndRound(), G_ClientEndRound(), G_ClientReadInventory(), G_ClientShoot(), G_ClientTeamInfo(), G_EdictsGetNewEdict(), G_EdictsInit(), G_EdictsReset(), G_GetPlayerForTeam(), G_GetPlayerName(), G_GetStartingTeam(), G_GetTeam(), G_InventoryDropToFloorCheck(), G_InventoryRemoveItemByID(), G_InventoryToFloor(), G_Players_f(), G_Say_f(), G_SpawnEntities(), G_SpawnItemOnFloor(), G_TeamToPM(), and G_VisToPM().
Definition at line 34 of file g_main.c.
Referenced by AI_ActorThink(), AI_CheckForMissionTargets(), AI_CheckUsingDoor(), AI_CivilianCalcBestAction(), AI_CreatePlayer(), AI_FighterCalcBestAction(), AI_FindHerdLocation(), AI_FindHidingLocation(), AI_InitPlayer(), AI_PrepBestAction(), AI_SearchBestTarget(), AI_SetCharacterValues(), AI_SetEquipment(), AI_TryToReloadWeapon(), AI_TurnIntoDirection(), AIL_ActorThink(), AIL_canreload(), AIL_Init(), AIL_InitActor(), AIL_positionshoot(), AIL_print(), AIL_reload(), AIL_Shutdown(), AIL_toTeamInt(), AIL_toTeamString(), Destroy_Breakable(), Door_Use(), ED_ParseEdict(), FS_LoadPackFile(), G_Actor2x2Spawn(), G_ActorFall(), G_ActorInvMove(), G_ActorReload(), G_ActorSetMaxs(), G_ActorSpawn(), G_AddItemToFloor(), G_AppearPerishEvent(), G_BuildForbiddenList(), G_CenterView(), G_CharacterGetMaxExperiencePerMission(), G_CheckForceEndRound(), G_ClientAction(), G_ClientAssignDefaultActorValues(), G_ClientBegin(), G_ClientCanReload(), G_ClientCommand(), G_ClientConnect(), G_ClientDisconnect(), G_ClientEndRound(), G_ClientGetFreeSpawnPointForActorSize(), G_ClientGetWeaponFromInventory(), G_ClientInitActorStates(), G_ClientMove(), G_ClientPrintf(), G_ClientReadCharacter(), G_ClientReadInventory(), G_ClientSendEdictsAndBrushModels(), G_ClientShoot(), G_ClientSkipActorInfo(), G_ClientSpawn(), G_ClientStateChange(), G_ClientStateChangeUpdate(), G_ClientTeamInfo(), G_ClientTurn(), G_ClientUseEdict(), G_ClientUserinfoChanged(), G_Damage(), G_EdictAppear(), G_EdictCalcOrigin(), G_EdictSetOrigin(), G_EdictsGetByNum(), G_EventActorDie(), G_EventActorFall(), G_EventActorRevitalise(), G_EventActorSendReservations(), G_EventActorStats(), G_EventActorTurn(), G_EventDestroyEdict(), G_EventEndRound(), G_EventInventoryAdd(), G_EventInventoryAmmo(), G_EventInventoryDelete(), G_EventInventoryReload(), G_EventParticleSpawn(), G_EventPerish(), G_EventReactionFireChange(), G_EventResetClientAction(), G_EventSendEdict(), G_EventSetClientAction(), G_EventShoot(), G_EventShootHidden(), G_EventSpawnSound(), G_EventStartShoot(), G_EventThrow(), G_FireAffectedSurface(), G_FreeEdict(), G_GetObjectForFiredef(), G_GetShotOrigin(), G_GetTeam(), G_InventoryDropToFloorCheck(), G_InventoryRemoveItemByID(), G_InventoryToFloor(), G_MatchSendResults(), G_MissionThink(), G_MissionTouch(), G_MissionUse(), G_Morale(), G_MoraleBehaviour(), G_MoralePanic(), G_MoraleRage(), G_MoveCalcLocal(), G_PhysicsStep(), G_PhysicsThink(), G_PrepareShot(), G_PrintStats(), G_ReactionFireReset(), G_ReadItem(), G_RecalcRouting(), G_Say_f(), G_SendCharacterData(), G_SendInventory(), G_SendInvisible(), G_SendParticle(), G_SendState(), G_ServerCommand(), G_SetTeamForPlayer(), G_ShootGrenade(), G_ShootSingle(), G_Spawn(), G_SpawnAIPlayer(), G_SpawnEntities(), G_SpawnFloor(), G_SpawnItemOnFloor(), G_SplashDamage(), G_TestLine(), G_TestLineWithEnts(), G_TouchEdicts(), G_TouchSolids(), G_TouchTriggers(), G_Trace(), G_TriggerSpawn(), G_WriteItem(), pos3L_goto(), SP_civilian_target(), SP_func_breakable(), SP_func_door(), SP_func_rotating(), SP_misc_item(), SP_misc_message(), SP_misc_mission(), SP_misc_mission_aliens(), SP_misc_model(), SP_trigger_hurt(), SP_trigger_rescue(), SP_trigger_touch(), SP_worldspawn(), SVCmd_AddIP_f(), SVCmd_AI_Add_f(), SVCmd_ListIP_f(), SVCmd_RemoveIP_f(), SVCmd_Win_f(), SVCmd_WriteIP_f(), and Touch_TouchTrigger().
Definition at line 35 of file g_main.c.
Referenced by G_EdictsGetNewEdict(), G_EdictsGetNext(), G_EdictsGetNextActor(), G_EdictsGetNumber(), and G_EdictsIsValidNum().
const inventoryImport_t inventoryImport = { G_FreeInventory, G_FreeAllInventory, G_AllocInventoryMemory } [static] |
Definition at line 33 of file g_main.c.
Referenced by _ase_load(), _pico_parse_skip_braced(), AI_CheckForMissionTargets(), AI_CivilianCalcBestAction(), AI_FighterCalcBestAction(), AI_PrepBestAction(), AI_Run(), AI_TurnIntoDirection(), AIL_positionshoot(), capture_to_close(), db_errorfb(), Destroy_Breakable(), G_ActionCheckForCurrentTeam(), G_Actor2x2Spawn(), G_ActorDie(), G_ActorDieOrStun(), G_ActorRevitalise(), G_ActorSpawn(), G_ActorSpawnIsAllowed(), G_ActorStun(), G_CheckFlood(), G_CheckForceEndRound(), G_CheckVis(), G_ClientBegin(), G_ClientDisconnect(), G_ClientEndRound(), G_ClientGetFreeSpawnPoint(), G_ClientGetFreeSpawnPointForActorSize(), G_ClientMove(), G_ClientSpawn(), G_EventEndRound(), G_GetActiveTeam(), G_GetNextActiveTeam(), G_GetStartingTeam(), G_GetTeam(), G_MatchDoEnd(), G_MatchEndCheck(), G_MatchEndTrigger(), G_MatchIsRunning(), G_MatchSendResults(), G_MissionThink(), G_MissionTouch(), G_Morale(), G_MoraleBehaviour(), G_MoveCalc(), G_PhysicsRun(), G_PhysicsStep(), G_PhysicsThink(), G_ReactionFireCanBeEnabled(), G_ReactionFireIsPossible(), G_SendInvisible(), G_SetTeamForPlayer(), G_ShootGrenade(), G_SpawnEntities(), getfunc(), luaB_error(), pos3L_goto(), RADAR_UpdateBaseRadarCoverage_f(), SP_alien_start(), SP_player_start(), SP_worldspawn(), start_capture(), TR_TestLineSingleTile(), UI_GenAllRadarMap(), UI_GenRadarMap_f(), and XVI_LoadXML().
FILE* logstatsfile |
Definition at line 50 of file g_main.c.
Referenced by G_Init(), G_PrintStats(), and G_Shutdown().
Definition at line 104 of file g_main.c.
Referenced by G_MoraleStopPanic().
Definition at line 102 of file g_main.c.
Referenced by G_MoraleBehaviour().
Definition at line 103 of file g_main.c.
Referenced by G_MoraleStopRage().
Definition at line 101 of file g_main.c.
Referenced by G_MoraleBehaviour().
Definition at line 73 of file g_main.c.
Referenced by G_Morale().
Definition at line 74 of file g_main.c.
Referenced by G_Morale().
Definition at line 77 of file g_main.c.
Referenced by G_Morale().
Definition at line 78 of file g_main.c.
Referenced by G_Morale().
Definition at line 76 of file g_main.c.
Referenced by G_Morale().
Definition at line 75 of file g_main.c.
Referenced by G_Morale().
Definition at line 94 of file g_main.c.
Referenced by G_Morale().
Definition at line 91 of file g_main.c.
Referenced by G_Morale().
Definition at line 99 of file g_main.c.
Referenced by AI_HideNeeded().
Definition at line 82 of file g_main.c.
Referenced by G_Morale().
Definition at line 85 of file g_main.c.
Referenced by G_Morale().
Definition at line 79 of file g_main.c.
Referenced by G_Morale().
Definition at line 98 of file g_main.c.
Referenced by G_ClientEndRound(), G_Damage(), G_MoraleBehaviour(), G_MoraleStopPanic(), and G_MoraleStopRage().
Definition at line 96 of file g_main.c.
Referenced by G_MoraleBehaviour().
Definition at line 97 of file g_main.c.
Referenced by G_MoraleBehaviour(), and G_ReactionFireIsPossible().
Definition at line 88 of file g_main.c.
Referenced by G_Morale().
Definition at line 37 of file g_main.c.
Referenced by G_ClientConnect().
Definition at line 58 of file g_main.c.
Referenced by AI_CreatePlayer().
Definition at line 43 of file g_main.c.
Referenced by G_IsMoraleEnabled(), and SP_worldspawn().
Definition at line 52 of file g_main.c.
Referenced by SV_FilterPacket(), and SVCmd_WriteIP_f().
Definition at line 61 of file g_main.c.
Referenced by G_SpawnEntities().
Definition at line 42 of file g_main.c.
Referenced by SP_worldspawn().
Definition at line 41 of file g_main.c.
Referenced by G_ActorSpawnIsAllowed(), SP_player_start(), and SP_worldspawn().
Definition at line 56 of file g_main.c.
Referenced by G_GetTeam(), and SP_worldspawn().
Definition at line 44 of file g_main.c.
Referenced by G_CheckForceEndRound().
cvar_t* sv_send_edicts [static] |
Definition at line 62 of file g_main.c.
Referenced by G_ShootSingle().
Definition at line 59 of file g_main.c.
Referenced by G_ClientBegin(), G_ClientEndRound(), and G_GetTeam().
const int TAG_INVENTORY = 2389 [static] |
Definition at line 120 of file g_main.c.
Referenced by G_AllocInventoryMemory(), and G_FreeAllInventory().