Updates to multiple headers

This commit is contained in:
Walter Julius Hennecke 2014-10-27 22:18:33 +01:00
parent 3ae1fe4614
commit bfc137ff2e
22 changed files with 1241 additions and 1203 deletions

View file

@ -1052,32 +1052,29 @@ ID system.
#define SECURITY_FILE "rpgxid.dat"
typedef struct {
unsigned long ID;
uint64_t ID;
//short padding;
unsigned long hash;
uint64_t hash;
//short padding2;
unsigned long playerID;
uint64_t playerID;
//short padding3;
} rpgxSecurityFile_t;
void BG_EvaluateTrajectory(const trajectory_t *tr, int atTime, vec3_t result);
void BG_EvaluateTrajectoryDelta(const trajectory_t *tr, int atTime, vec3_t result);
void BG_EvaluateTrajectory(const trajectory_t* tr, int32_t atTime, vec3_t result);
void BG_EvaluateTrajectoryDelta(const trajectory_t* tr, int32_t atTime, vec3_t result);
void BG_AddPredictableEventToPlayerstate(int32_t newEvent, int32_t eventParm, playerState_t* ps);
void BG_PlayerStateToEntityState(playerState_t *ps, entityState_t *s, qboolean snap);
void BG_PlayerStateToEntityState(playerState_t* ps, entityState_t* s, qboolean snap);
qboolean BG_PlayerTouchesItem(playerState_t *ps, entityState_t *item, int atTime);
qboolean BG_PlayerTouchesItem(playerState_t* ps, entityState_t* item, int32_t atTime);
char *NextWordEndsHere(char *pos);
char *EndWord(char *pos);
char* NextWordEndsHere(char* pos);
char* EndWord(char* pos);
#define ARENAS_PER_TIER 4
//make this match Max_Ammo in g_items please;
#define PHASER_AMMO_MAX 50
extern int Max_Ammo[];
extern int32_t Max_Ammo[];
#endif /* BG_PUBLIC_H_ */

View file

@ -14,115 +14,117 @@
//========================================================
//========================================================
//name
#define CHARACTERISTIC_NAME 0 //string
//gender of the bot
#define CHARACTERISTIC_GENDER 1 //string ("male", "female", "it")
//attack skill
// > 0.0 && < 0.2 = don't move
// > 0.3 && < 1.0 = aim at enemy during retreat
// > 0.0 && < 0.4 = only move forward/backward
// >= 0.4 && < 1.0 = circle strafing
// > 0.7 && < 1.0 = random strafe direction change
#define CHARACTERISTIC_ATTACK_SKILL 2 //float [0, 1]
//weapon weight file
#define CHARACTERISTIC_WEAPONWEIGHTS 3 //string
//view angle difference to angle change factor
#define CHARACTERISTIC_VIEW_FACTOR 4 //float <0, 1]
//maximum view angle change
#define CHARACTERISTIC_VIEW_MAXCHANGE 5 //float [1, 360]
//reaction time in seconds
#define CHARACTERISTIC_REACTIONTIME 6 //float [0, 5]
//accuracy when aiming
#define CHARACTERISTIC_AIM_ACCURACY 7 //float [0, 1]
//weapon specific aim accuracy
#define CHARACTERISTIC_AIM_ACCURACY_GRENADELAUNCHER 8 //float [0, 1]
#define CHARACTERISTIC_AIM_ACCURACY_STASIS 9 //float [0, 1]
#define CHARACTERISTIC_AIM_ACCURACY_PHASER 10 //float [0, 1]
#define CHARACTERISTIC_AIM_ACCURACY_DREADNOUGHT 11 //float [0, 1]
#define CHARACTERISTIC_AIM_ACCURACY_IMOD 12 //float [0, 1]
#define CHARACTERISTIC_AIM_ACCURACY_COMPRESSION 13 //float [0, 1]
#define CHARACTERISTIC_AIM_ACCURACY_TETRION 14 //float [0, 1]
#define CHARACTERISTIC_AIM_ACCURACY_SCAVENGER 15 //float [0, 1]
#define CHARACTERISTIC_AIM_ACCURACY_QUANTUM 16 //float [0, 1]
enum charCharactetistic_e {
//name
CHARACTERISTIC_NAME, //string
//gender of the bot
CHARACTERISTIC_GENDER, //string ("male", "female", "it")
//attack skill
// > 0.0 && < 0.2 = don't move
// > 0.3 && < 1.0 = aim at enemy during retreat
// > 0.0 && < 0.4 = only move forward/backward
// >= 0.4 && < 1.0 = circle strafing
// > 0.7 && < 1.0 = random strafe direction change
CHARACTERISTIC_ATTACK_SKILL, //float [0, 1]
//weapon weight file
CHARACTERISTIC_WEAPONWEIGHTS, //string
//view angle difference to angle change factor
CHARACTERISTIC_VIEW_FACTOR, //float <0, 1]
//maximum view angle change
CHARACTERISTIC_VIEW_MAXCHANGE, //float [1, 360]
//reaction time in seconds
CHARACTERISTIC_REACTIONTIME, //float [0, 5]
//accuracy when aiming
CHARACTERISTIC_AIM_ACCURACY, //float [0, 1]
//weapon specific aim accuracy
CHARACTERISTIC_AIM_ACCURACY_GRENADELAUNCHER, //float [0, 1]
CHARACTERISTIC_AIM_ACCURACY_STASIS, //float [0, 1]
CHARACTERISTIC_AIM_ACCURACY_PHASER, //float [0, 1]
CHARACTERISTIC_AIM_ACCURACY_DREADNOUGHT, //float [0, 1]
CHARACTERISTIC_AIM_ACCURACY_IMOD, //float [0, 1]
CHARACTERISTIC_AIM_ACCURACY_COMPRESSION, //float [0, 1]
CHARACTERISTIC_AIM_ACCURACY_TETRION, //float [0, 1]
CHARACTERISTIC_AIM_ACCURACY_SCAVENGER, //float [0, 1]
CHARACTERISTIC_AIM_ACCURACY_QUANTUM, //float [0, 1]
//skill when aiming
// > 0.0 && < 0.9 = aim is affected by enemy movement
// > 0.4 && <= 0.8 = enemy linear leading
// > 0.8 && <= 1.0 = enemy exact movement leading
// > 0.5 && <= 1.0 = prediction shots when enemy is not visible
// > 0.6 && <= 1.0 = splash damage by shooting nearby geometry
#define CHARACTERISTIC_AIM_SKILL 17 //float [0, 1]
//skill when aiming
// > 0.0 && < 0.9 = aim is affected by enemy movement
// > 0.4 && <= 0.8 = enemy linear leading
// > 0.8 && <= 1.0 = enemy exact movement leading
// > 0.5 && <= 1.0 = prediction shots when enemy is not visible
// > 0.6 && <= 1.0 = splash damage by shooting nearby geometry
CHARACTERISTIC_AIM_SKILL, //float [0, 1]
#define CHARACTERISTIC_AIM_SKILL_STASIS 18 //float [0, 1]
#define CHARACTERISTIC_AIM_SKILL_GRENADELAUNCHER 19 //float [0, 1]
#define CHARACTERISTIC_AIM_SKILL_QUANTUM 20 //float [0, 1]
CHARACTERISTIC_AIM_SKILL_STASIS, //float [0, 1]
CHARACTERISTIC_AIM_SKILL_GRENADELAUNCHER, //float [0, 1]
CHARACTERISTIC_AIM_SKILL_QUANTUM, //float [0, 1]
//========================================================
//chat
//========================================================
//file with chats
#define CHARACTERISTIC_CHAT_FILE 21 //string
//name of the chat character
#define CHARACTERISTIC_CHAT_NAME 22 //string
//characters per minute type speed
#define CHARACTERISTIC_CHAT_CPM 23 //integer [1, 4000]
//tendency to insult/praise
#define CHARACTERISTIC_CHAT_INSULT 24 //float [0, 1]
//tendency to chat misc
#define CHARACTERISTIC_CHAT_MISC 25 //float [0, 1]
//tendency to chat at start or end of level
#define CHARACTERISTIC_CHAT_STARTENDLEVEL 26 //float [0, 1]
//tendency to chat entering or exiting the game
#define CHARACTERISTIC_CHAT_ENTEREXITGAME 27 //float [0, 1]
//tendency to chat when killed someone
#define CHARACTERISTIC_CHAT_KILL 28 //float [0, 1]
//tendency to chat when died
#define CHARACTERISTIC_CHAT_DEATH 29 //float [0, 1]
//tendency to chat when enemy suicides
#define CHARACTERISTIC_CHAT_ENEMYSUICIDE 30 //float [0, 1]
//tendency to chat when hit while talking
#define CHARACTERISTIC_CHAT_HITTALKING 31 //float [0, 1]
//tendency to chat when bot was hit but didn't die
#define CHARACTERISTIC_CHAT_HITNODEATH 32 //float [0, 1]
//tendency to chat when bot hit the enemy but enemy didn't die
#define CHARACTERISTIC_CHAT_HITNOKILL 33 //float [0, 1]
//tendency to randomly chat
#define CHARACTERISTIC_CHAT_RANDOM 34 //float [0, 1]
//tendency to reply
#define CHARACTERISTIC_CHAT_REPLY 35 //float [0, 1]
//========================================================
//movement
//========================================================
//tendency to crouch
#define CHARACTERISTIC_CROUCHER 36 //float [0, 1]
//tendency to jump
#define CHARACTERISTIC_JUMPER 37 //float [0, 1]
//tendency to walk
#define CHARACTERISTIC_WALKER 38 //float [0, 1]
//tendency to jump using a weapon
#define CHARACTERISTIC_WEAPONJUMPING 39 //float [0, 1]
//========================================================
//goal
//========================================================
//item weight file
#define CHARACTERISTIC_ITEMWEIGHTS 40 //string
//the aggression of the bot
#define CHARACTERISTIC_AGGRESSION 41 //float [0, 1]
//the self preservation of the bot (rockets near walls etc.)
#define CHARACTERISTIC_SELFPRESERVATION 42 //float [0, 1]
//how likely the bot is to take revenge
#define CHARACTERISTIC_VENGEFULNESS 43 //float [0, 1] //use this!!
//tendency to camp
#define CHARACTERISTIC_CAMPER 44 //float [0, 1]
//========================================================
//========================================================
//tendency to get easy frags
#define CHARACTERISTIC_EASY_FRAGGER 45 //float [0, 1]
//how alert the bot is (view distance)
#define CHARACTERISTIC_ALERTNESS 46 //float [0, 1]
//how much the bot fires it's weapon
#define CHARACTERISTIC_FIRETHROTTLE 47 //float [0, 1]
//========================================================
//chat
//========================================================
//file with chats
CHARACTERISTIC_CHAT_FILE, //string
//name of the chat character
CHARACTERISTIC_CHAT_NAME, //string
//characters per minute type speed
CHARACTERISTIC_CHAT_CPM, //integer [1, 4000]
//tendency to insult/praise
CHARACTERISTIC_CHAT_INSULT, //float [0, 1]
//tendency to chat misc
CHARACTERISTIC_CHAT_MISC, //float [0, 1]
//tendency to chat at start or end of level
CHARACTERISTIC_CHAT_STARTENDLEVEL, //float [0, 1]
//tendency to chat entering or exiting the game
CHARACTERISTIC_CHAT_ENTEREXITGAME, //float [0, 1]
//tendency to chat when killed someone
CHARACTERISTIC_CHAT_KILL, //float [0, 1]
//tendency to chat when died
CHARACTERISTIC_CHAT_DEATH, //float [0, 1]
//tendency to chat when enemy suicides
CHARACTERISTIC_CHAT_ENEMYSUICIDE, //float [0, 1]
//tendency to chat when hit while talking
CHARACTERISTIC_CHAT_HITTALKING, //float [0, 1]
//tendency to chat when bot was hit but didn't die
CHARACTERISTIC_CHAT_HITNODEATH, //float [0, 1]
//tendency to chat when bot hit the enemy but enemy didn't die
CHARACTERISTIC_CHAT_HITNOKILL, //float [0, 1]
//tendency to randomly chat
CHARACTERISTIC_CHAT_RANDOM, //float [0, 1]
//tendency to reply
CHARACTERISTIC_CHAT_REPLY, //float [0, 1]
//========================================================
//movement
//========================================================
//tendency to crouch
CHARACTERISTIC_CROUCHER, //float [0, 1]
//tendency to jump
CHARACTERISTIC_JUMPER, //float [0, 1]
//tendency to walk
CHARACTERISTIC_WALKER, //float [0, 1]
//tendency to jump using a weapon
CHARACTERISTIC_WEAPONJUMPING, //float [0, 1]
//========================================================
//goal
//========================================================
//item weight file
CHARACTERISTIC_ITEMWEIGHTS, //string
//the aggression of the bot
CHARACTERISTIC_AGGRESSION, //float [0, 1]
//the self preservation of the bot (rockets near walls etc.)
CHARACTERISTIC_SELFPRESERVATION, //float [0, 1]
//how likely the bot is to take revenge
CHARACTERISTIC_VENGEFULNESS, //float [0, 1] //use this!!
//tendency to camp
CHARACTERISTIC_CAMPER, //float [0, 1]
//========================================================
//========================================================
//tendency to get easy frags
CHARACTERISTIC_EASY_FRAGGER, //float [0, 1]
//how alert the bot is (view distance)
CHARACTERISTIC_ALERTNESS, //float [0, 1]
//how much the bot fires it's weapon
CHARACTERISTIC_FIRETHROTTLE //float [0, 1]
};
#endif /* CHARS_H_ */

View file

@ -93,7 +93,7 @@ void breakable_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker,
/**
* Called when a breakable takes damage
*/
void breakable_pain ( gentity_t *self, gentity_t *attacker, int32_t damage )
void G_Breakable_Pain ( gentity_t *self, gentity_t *attacker, int32_t damage )
{
if ( self->pain_debounce_time > level.time ) {
return;
@ -114,7 +114,7 @@ void breakable_pain ( gentity_t *self, gentity_t *attacker, int32_t damage )
/**
* Called if a brealable has been used
*/
void breakable_use (gentity_t *self, gentity_t *other, gentity_t *activator)
void G_Breakable_Use (gentity_t *self, gentity_t *other, gentity_t *activator)
{
breakable_die( self, other, activator, self->health, MOD_UNKNOWN );
}
@ -122,7 +122,7 @@ void breakable_use (gentity_t *self, gentity_t *other, gentity_t *activator)
/**
* Inits a breakable brush entity
*/
void InitBBrush ( gentity_t *ent )
void G_Breakable_InitBrush ( gentity_t *ent )
{
float light = 0.0f;
vec3_t color;
@ -336,11 +336,11 @@ void SP_func_breakable( gentity_t *self )
self->damage = self->health;
G_SoundIndex("sound/weapons/explosions/cargoexplode.wav");//precaching
self->use = breakable_use;
self->use = G_Breakable_Use;
self->count = 1; // GSIO01
if ( self->paintarget != NULL ) {
self->pain = breakable_pain;
self->pain = G_Breakable_Pain;
}
if (self->model == NULL) {
@ -348,7 +348,7 @@ void SP_func_breakable( gentity_t *self )
}
VectorCopy(self->s.origin, self->pos1);
trap_LinkEntity(self);
InitBBrush( self );
G_Breakable_InitBrush( self );
level.numBrushEnts++;
}
@ -447,12 +447,12 @@ void SP_misc_model_breakable( gentity_t *ent )
ent->damage = ent->health;
ent->use = breakable_use;
ent->use = G_Breakable_Use;
if ( ent->health != 0 ) {
G_SoundIndex("sound/weapons/explosions/cargoexplode.wav");
ent->takedamage = qtrue;
ent->pain = breakable_pain;
ent->pain = G_Breakable_Pain;
ent->die = breakable_die;
}
@ -706,7 +706,7 @@ void SP_misc_ammo_station( gentity_t *ent )
if ( ent->health != 0 ) {
ent->takedamage = qtrue;
ent->pain = breakable_pain;
ent->pain = G_Breakable_Pain;
ent->die = breakable_die;
}
@ -755,14 +755,14 @@ void target_repair_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
target->r.svFlags &= ~SVF_NOCLIENT;
target->s.eFlags &= ~EF_NODRAW;
InitBBrush(target);
G_Breakable_InitBrush(target);
target->health = target->damage;
target->takedamage = qtrue;
target->use = breakable_use;
target->use = G_Breakable_Use;
if(target->paintarget != NULL) {
target->pain = breakable_pain;
target->pain = G_Breakable_Pain;
}
target->clipmask = 0;

View file

@ -1,9 +1,9 @@
#ifndef G_BREAKABLE_H_
#define G_BREAKABLE_H_
void InitBBrush(gentity_t* ent);
void breakable_use(gentity_t* self, gentity_t* other, gentity_t* activator);
void breakable_pain(gentity_t* self, gentity_t* attacker, int32_t damage);
#endif /* G_BREAKABLE_H_ */
#ifndef G_BREAKABLE_H_
#define G_BREAKABLE_H_
void G_Breakable_InitBrush(gentity_t* ent);
void G_Breakable_Use(gentity_t* self, gentity_t* other, gentity_t* activator);
void G_Breakable_Pain(gentity_t* self, gentity_t* attacker, int32_t damage);
#endif /* G_BREAKABLE_H_ */

View file

@ -727,16 +727,16 @@ void G_Combat_Repair(gentity_t* ent, gentity_t* tr_ent, double rate) {
trap_SetBrushModel(tr_ent, tr_ent->model);
tr_ent->r.svFlags &= ~SVF_NOCLIENT;
tr_ent->s.eFlags &= ~EF_NODRAW;
InitBBrush(tr_ent);
G_Breakable_InitBrush(tr_ent);
if (tr_ent->health) {
tr_ent->takedamage = qtrue;
}
tr_ent->use = breakable_use;
tr_ent->use = G_Breakable_Use;
if (tr_ent->paintarget) {
tr_ent->pain = breakable_pain;
tr_ent->pain = G_Breakable_Pain;
}
tr_ent->clipmask = 0;

View file

@ -3,16 +3,18 @@
#include "g_local.h"
// damage flags
#define DAMAGE_RADIUS 0x00000001 //!< damage was indirect
#define DAMAGE_NO_ARMOR 0x00000002 //!< armor (shields) do not protect from this damage
#define DAMAGE_NO_KNOCKBACK 0x00000008 //!< do not affect velocity, just view angles
#define DAMAGE_NO_PROTECTION 0x00000020 //!< armor, shields, invulnerability, and godmode have no effect
#define DAMAGE_NOT_ARMOR_PIERCING 0x00000000 //!< trek: shields fully protect from this damage (for clarity)
#define DAMAGE_ARMOR_PIERCING 0x00000040 //!< trek: shields don't fully protect from this damage
#define DAMAGE_NO_INVULNERABILITY 0x00000080 //!< trek: invulnerability doesn't event protect from this damage
#define DAMAGE_HALF_NOTLOS 0x00000100 //!< trek: radius damage still does 1/2 damage to ents that do not have LOS to explosion org but are in radius
#define DAMAGE_ALL_TEAMS 0x00000200 //!< trek: damage ignores teamdamage settings
// damage flags+
enum g_combatDamageFlags_e {
DAMAGE_RADIUS = 0x00000001, //!< damage was indirect
DAMAGE_NO_ARMOR = 0x00000002, //!< armor (shields) do not protect from this damage
DAMAGE_NO_KNOCKBACK = 0x00000008, //!< do not affect velocity, just view angles
DAMAGE_NO_PROTECTION = 0x00000020, //!< armor, shields, invulnerability, and godmode have no effect
DAMAGE_NOT_ARMOR_PIERCING = 0x00000000, //!< trek: shields fully protect from this damage (for clarity)
DAMAGE_ARMOR_PIERCING = 0x00000040, //!< trek: shields don't fully protect from this damage
DAMAGE_NO_INVULNERABILITY = 0x00000080, //!< trek: invulnerability doesn't event protect from this damage
DAMAGE_HALF_NOTLOS = 0x00000100, //!< trek: radius damage still does 1/2 damage to ents that do not have LOS to explosion org but are in radius
DAMAGE_ALL_TEAMS = 0x00000200 //!< trek: damage ignores teamdamage settings
};
/**
* Damage all entities around an origin in a specified radius.
@ -69,7 +71,7 @@ void G_Combat_GibEntity(gentity_t* self, int32_t killer);
void G_Combat_Damage(gentity_t* targ, /*@null@*/ gentity_t* inflictor, /*@null@*/ gentity_t* attacker, /*@null@*/ vec3_t dir, /*@null@*/ vec3_t point, int32_t damage, int32_t dflags, int32_t mod);
/**
* \brief Returns qtrue if the inflictor can directly damage the target.
* \brief Returns qtrue if the inflictor can directly damage the target.
* Used for explosions and melee attacks.
*
* \param targ the target

View file

@ -11,13 +11,16 @@ typedef struct
char text[128];
} group_list_t;
#define MAX_GROUP_MEMBERS 1024
enum g_groupsLimits_e {
MAX_SKINS_FOR_RACE = 128,
MAX_GROUP_MEMBERS = 1024
};
extern group_list_t group_list[MAX_GROUP_MEMBERS];
extern int group_count;
/*@shared@*/ /*@null@*/ extern char *G_searchGroupList(const char *name);
extern int32_t group_count;
/*@shared@*/ /*@null@*/ extern char* G_searchGroupList(const char* name);
#define MAX_SKINS_FOR_RACE 128
#endif /* G_GROUPS_H_ */

View file

@ -1,104 +1,106 @@
#ifndef _G_ITEMS_H
#define _G_ITEMS_H
#include "g_local.h"
#include "g_active.h"
/**
* Data structures + functions for the PADD messaging system.
*
* \author Ubergames - Marcin
* \date 06/12/2008
*/
typedef struct
{
gentity_t* key; //!< PADD item entity pointer
char owner[64];
char value[256];
} paddData_t;
#define PADD_DATA_MAX 256 //!< max number of padds
#define MAX_DROPPED 255 //!< should be reasonable
extern paddData_t paddData[PADD_DATA_MAX];
extern int paddDataNum;
extern int numTotalDropped;
/**
* Run an item.
*
* \param ent The item.
*/
void G_RunItem( gentity_t* ent );
/**
* Sets the clipping size and plants the object on the floor.
* Items can't be immediately dropped to floor, because they might
* be on an entity that hasn't spawned yet.
*
* \param ent Entity for item.
* \param item The item.
*/
void G_SpawnItem (gentity_t* ent, gitem_t* item);
/**
* Spawns an item and tosses it forward.
*
* \param ent An entity to toss from.
* \param item The item.
* \param angle Direction to toss to.
* \return The entity for the item.
*/
/*@shared@*/ /*@null@*/ gentity_t* Drop_Item( gentity_t* ent, gitem_t* item, double angle );
/**
* Clear all registered items.
*/
void ClearRegisteredItems( void );
/**
* Register a new item. The item will be added to the precache list.
*
* \param item Item to register.
*/
void RegisterItem( gitem_t* item );
/**
* Write the needed items to a config string so the client will know which ones to precache.
*/
void SaveRegisteredItems( void );
/**
* Drop a weapon.
*
* \author Ubergames - Marcin
* \date 03/12/2008
* \param ent The client.
* \param item The item.
* \param angle Angle to throw at.
* \param flags Entity flags to use.
* \param Optional message for PADD dropping.
*/
/*@shared@*/ /*@null@*/ gentity_t *DropWeapon( gentity_t* ent, gitem_t* item, double angle, int32_t flags, char* txt );
/*
================
FinishSpawningDetpack
Traces down to find where an item should rest, instead of letting them
free fall from their spawn points
================
*/
qboolean FinishSpawningDetpack( gentity_t* ent, int32_t itemIndex );
//! Min ammount of weapons a player can have for each weapons
extern vmCvar_t* Min_Weapons[];
//! Max ammount of weapons a player can have for each weapons
extern vmCvar_t* Max_Weapons[];
//RPG-X: Marcin: for easier lookup - 30/12/2008
int32_t Max_Weapon(int32_t num);
int32_t Min_Weapon(int32_t num);
#ifndef _G_ITEMS_H
#define _G_ITEMS_H
#include "g_local.h"
#include "g_active.h"
/**
* Data structures + functions for the PADD messaging system.
*
* \author Ubergames - Marcin
* \date 06/12/2008
*/
typedef struct
{
gentity_t* key; //!< PADD item entity pointer
char owner[64];
char value[256];
} paddData_t;
enum g_itemsLimits_e {
MAX_DROPPED = 255, //!< should be reasonable
PADD_DATA_MAX = 256 //!< max number of padds
};
extern paddData_t paddData[PADD_DATA_MAX];
extern int32_t paddDataNum;
extern int32_t numTotalDropped;
/**
* Run an item.
*
* \param ent The item.
*/
void G_RunItem( gentity_t* ent );
/**
* Sets the clipping size and plants the object on the floor.
* Items can't be immediately dropped to floor, because they might
* be on an entity that hasn't spawned yet.
*
* \param ent Entity for item.
* \param item The item.
*/
void G_SpawnItem (gentity_t* ent, gitem_t* item);
/**
* Spawns an item and tosses it forward.
*
* \param ent An entity to toss from.
* \param item The item.
* \param angle Direction to toss to.
* \return The entity for the item.
*/
/*@shared@*/ /*@null@*/ gentity_t* Drop_Item( gentity_t* ent, gitem_t* item, double angle );
/**
* Clear all registered items.
*/
void ClearRegisteredItems( void );
/**
* Register a new item. The item will be added to the precache list.
*
* \param item Item to register.
*/
void RegisterItem( gitem_t* item );
/**
* Write the needed items to a config string so the client will know which ones to precache.
*/
void SaveRegisteredItems( void );
/**
* Drop a weapon.
*
* \author Ubergames - Marcin
* \date 03/12/2008
* \param ent The client.
* \param item The item.
* \param angle Angle to throw at.
* \param flags Entity flags to use.
* \param Optional message for PADD dropping.
*/
/*@shared@*/ /*@null@*/ gentity_t *DropWeapon( gentity_t* ent, gitem_t* item, double angle, int32_t flags, char* txt );
/*
================
FinishSpawningDetpack
Traces down to find where an item should rest, instead of letting them
free fall from their spawn points
================
*/
qboolean FinishSpawningDetpack( gentity_t* ent, int32_t itemIndex );
//! Min ammount of weapons a player can have for each weapons
extern vmCvar_t* Min_Weapons[];
//! Max ammount of weapons a player can have for each weapons
extern vmCvar_t* Max_Weapons[];
//RPG-X: Marcin: for easier lookup - 30/12/2008
int32_t Max_Weapon(int32_t num);
int32_t Min_Weapon(int32_t num);
#endif /* _G_ITEMS_H */

View file

@ -1,422 +1,424 @@
#ifndef _G_LUA_H
#define _G_LUA_H
#include "g_local.h"
#if (defined __linux__ || defined __WIN32__) // linux or mingw
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#else
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#endif
#define NUM_VMS 3
#if defined __linux__
#define HOSTARCH "UNIX"
#define EXTENSION "so"
#elif defined WIN32
#define HOSTARCH "WIN32"
#define EXTENSION "dll"
#elif defined __APPLE__
#define HOSTARCH "UNIX"
#define EXTENSION "dylib"
#endif
#define Lua_RegisterGlobal(L, n, v) (lua_pushstring(L, v), lua_setglobal(L, n))
#define Lua_RegConstInteger(L, n) (lua_pushstring(L, #n), lua_pushinteger(L, n), lua_settable(L, -3))
#define Lua_RegConstString(L, n) (lua_pushstring(L, #n), lua_pushstring(L, n), lua_settable(L, -3))
typedef struct {
int id;
char filename[MAX_QPATH];
char *code;
int code_size;
int error;
lua_State *L;
} lvm_t;
extern lvm_t *lVM[NUM_VMS];
/**
* @brief A debug print function for Lua.
*
* @author GSIO01
* @date 14.10.2013
*
* @param fmt Describes the format to use.
*
*/
void QDECL LUA_DEBUG(const char *fmt, ...);
/**
* @brief Lua logger.
*
* @author GSIO01
* @date 14.10.2013
*
* @param fmt Describes the format to use.
*
*/
void QDECL LUA_LOG(const char *fmt, ...);
/**
* @brief Initialize Lua.
*
* @author GSIO01
* @date 14.10.2013
*
* @return A qboolean indicating success of failure.
*/
qboolean G_Lua_Init(void);
/**
* @brief A Lua function call.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] vm If non-null, the virtual mashine.
* @param [in] func If non-null, the function.
* @param nargs Number of arguments.
* @param nresults Number of results.
*
* @return A qboolean indicating success or failure.
*/
qboolean G_Lua_Call(lvm_t *vm, char *func, int nargs, int nresults);
/**
* @brief Resume execution of a Lua vm.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] vm If non-null, the virtual mashine.
* @param [in] T If non-null, the lua_State * to process.
* @param [in] func If non-null, the function.
* @param nargs The nargs.
*
* @return A qboolean indicating success of failure.
*/
qboolean G_Lua_Resume(lvm_t *vm, lua_State *T, char *func, int nargs);
/**
* @brief Get a Lua function.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] vm If non-null, the virtual mashine.
* @param [in] name If non-null, the name.
*
* @return A qboolean.
*/
qboolean G_Lua_GetFunction(lvm_t *vm, char *name);
/**
* @brief Start Lua VM.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] vm If non-null, the virtual mashine.
*
* @return A qboolean.
*/
qboolean G_Lua_StartVM(lvm_t *vm);
/**
* @brief Stop Lua VM.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] vm If non-null, the virtual mashine.
*/
void G_Lua_StopVM(lvm_t *vm);
/**
* @brief Shutdown Lua.
*
* @author GSIO01
* @date 14.10.2013
*/
void G_Lua_Shutdown(void);
/**
* @brief Print the lua status to a client console.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] ent If non-null, the client.
*/
void G_Lua_Status(gentity_t *ent);
/**
* @brief Get the lua VM for a given Lua state.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] L If non-null, the lua_State * to process.
*
* @return null if it fails, else a lvm_t*.
*/
lvm_t* G_Lua_GetVM(lua_State *L);
// lua_entity.c
typedef struct {
gentity_t *e;
} lent_t;
/**
* @brief Open lua entity library.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] L If non-null, the lua_State * to process.
*
* @return An int.
*/
int Luaopen_Entity(lua_State *L);
/**
* @brief Push an entity onto the lua stack.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] L If non-null, the lua_State * to process.
* @param [in] ent If non-null, the entity to push.
*/
void Lua_PushEntity(lua_State *L, gentity_t *ent);
/**
* @brief Get an entity from the lua stack.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] L If non-null, the lua_State * to process.
* @param argNum The argument which is the entity.
*
* @return null if it fails, else a lent_t*.
*/
lent_t* Lua_GetEntity(lua_State *L, int argNum);
/**
* @brief Open lua weapons library.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] L If non-null, the lua_State * to process.
*
* @return An int.
*/
int Luaopen_Weapons(lua_State *L);
// lua_trace.c
typedef struct {
trace_t *tr;
} ltrace_t;
void Lua_PushTrace(lua_State* L, trace_t* tr);
ltrace_t *Lua_GetTrace(lua_State* L, int argNum);
int Luaopen_Trace(lua_State* L);
// lua_game.c
int Luaopen_Game(lua_State *L);
// lua_qmath.c
int Luaopen_Qmath(lua_State *L);
// lua_vector.c
int Luaopen_Vector(lua_State *L);
void Lua_PushVector(lua_State *L, vec3_t v);
vec_t *Lua_GetVector(lua_State *L, int argNum);
int Lua_IsVector(lua_State *L, int index);
vec3_t *Lua_GetVectorMisc(lua_State *L, int *index);
// lua_mover.c
int Luaopen_Mover(lua_State *L);
// lua_cinematic.c
int Luaopen_Cinematic(lua_State *L);
// lua_sound.c
int Luaopen_Sound(lua_State *L);
/**
* Lua hook for InitGame event.
*
* \param leveltime level time the event occured
* \param radomseed a random seed
* \param restart is this a map restart?
*/
void LuaHook_G_InitGame(int leveltime, unsigned int randomseed, int restart);
/**
* Lua hook for weapon firing.
*
* \param ent The player.
* \param muzzle The muzzle point.
* \param forwar The forward vector.
* \param alt_fire Indicator whether the shot is alternative fire mode.
* \param weapon Weapon number.
*/
void LuaHook_G_FireWeapon(int ent, vec3_t muzzle, vec3_t forward, int alt_fire, int weapon);
/**
* Lua hook for Shutdown event.
*
* \param restart is this a map restart?
*/
void LuaHook_G_Shutdown(int restart);
/**
* Lua hook for RunFrame event.
*
* \param leveltime the level time
*/
void LuaHook_G_RunFrame(int leveltime);
/**
* Lua hook for G_Print function.
*
* \param text text to be printed
*/
void LuaHook_G_Print(char* text);
/**
* Lua hook for G_ClientPrint function.
*
* \param text text to be printed
* \param entnum entity index for client the text gets send to
*/
void LuaHook_G_ClientPrint(char* text, int entnum);
/**
* Lua hook for entity think function function.
*
* \param function name of function to call
* \param entnum entity index of entity the think function was called on
* \return success or fail
*/
void LuaHook_G_EntityThink(char* function, int entnum);
/**
* Lua hook for entity touch function function.
*
* \param function name of function to call
* \param entnum entity index of entity the touch function was called on
* \param othernum entiy index of touching entity
* \return success or fail
*/
void LuaHook_G_EntityTouch(char* function, int entnum, int othernum);
/**
* Lua hook for entity use function.
*
* \param function name of function to call
* \param entnum entity index of entity the use function was called on
* \param othernum entity index of other entity
* \param activatornum entity index of activating entity
*/
void LuaHook_G_EntityUse(char* function, int entnum, int othernum, int activatornum);
/**
* Lua hook for entity hurt function.
*
* \param function name of function to call
* \param entnum entity index of entity the hurt function was called on
* \param inflictornum entity index of inflictor
* \param attackernum entity index of attacker
*/
void LuaHook_G_EntityHurt(char* function, int entnum, int inflictornum, int attackernum);
/**
* Lua hook for entity die function.
*
* \param function name of function to call
* \param entnum entity index of entity the die function was called on
* \param inflictornum entity index of inflictor
* \param attackernum entity index of attacker
* \param dmg ammount of damage
* \param mod means of death
*/
void LuaHook_G_EntityDie(char* function, int entnum, int inflictornum, int attackernum, int dmg, int mod);
/**
* Lua hook for entity free function.
*
* \param function name of function to call
* \param entnum entity index of entity the free function was called on
*/
void LuaHook_G_EntityFree(char* function, int entnum);
/**
* Lua hook for entity trigger function.
*
* \param function name of function to call
* \param entnum entity index of entity the trigger function was called on
* \param othernum entity index of triggering entity
*/
void LuaHook_G_EntityTrigger(char* function, int entnum, int othernum);
/**
* Lua hook for entity spawn function.
*
* \param function name of function to call
* \param entnum entity index of entity the spawn function was called on
*/
void LuaHook_G_EntitySpawn(char* function, int entnum);
/**
* Lua hook for entity reached function.
*
* \param function name of function to call
* \param entnum entity index of entity the reached function was called on
*/
void LuaHook_G_EntityReached(char* function, int entnum);
/**
* Lua hook for entity reached angular function.
*
* \param function name of function to call
* \param entnum entity index of entity the reached angular function was called on
*/
void LuaHook_G_EntityReachedAngular(char* function, int entnum);
/**
* \fn unsigned G_Lua_NumThreads(void);
*
* \brief Get information about lua threads.
*
* Prints status information about lua threads and returns the number of active lua threads.
*
* \author GSIO01
* \date 14.10.2013
*
* \return An unsigned.
*/
void LuaHook_G_CmdScriptCall(char* function);
unsigned G_Lua_NumThreads(void);
/**
* \fn void G_Lua_CollectGarbage(void);
*
* \brief Garbage collection of inactive lua threads.
*
* \author GSIO01
* \date 14.10.2013
*/
void G_Lua_CollectGarbage(void);
#endif
#ifndef _G_LUA_H
#define _G_LUA_H
#include "g_local.h"
#if (defined __linux__ || defined __WIN32__) // linux or mingw
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#else
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#endif
enum g_luaLimits_e {
NUM_VMS = 3
};
#if defined __linux__
#define HOSTARCH "UNIX"
#define EXTENSION "so"
#elif defined WIN32
#define HOSTARCH "WIN32"
#define EXTENSION "dll"
#elif defined __APPLE__
#define HOSTARCH "UNIX"
#define EXTENSION "dylib"
#endif
#define Lua_RegisterGlobal(L, n, v) (lua_pushstring(L, v), lua_setglobal(L, n))
#define Lua_RegConstInteger(L, n) (lua_pushstring(L, #n), lua_pushinteger(L, n), lua_settable(L, -3))
#define Lua_RegConstString(L, n) (lua_pushstring(L, #n), lua_pushstring(L, n), lua_settable(L, -3))
typedef struct {
int32_t id;
char filename[MAX_QPATH];
char* code;
int32_t code_size;
int32_t error;
lua_State* L;
} lvm_t;
extern lvm_t* lVM[NUM_VMS];
/**
* @brief A debug print function for Lua.
*
* @author GSIO01
* @date 14.10.2013
*
* @param fmt Describes the format to use.
*
*/
void QDECL LUA_DEBUG(const char* fmt, ...);
/**
* @brief Lua logger.
*
* @author GSIO01
* @date 14.10.2013
*
* @param fmt Describes the format to use.
*
*/
void QDECL LUA_LOG(const char* fmt, ...);
/**
* @brief Initialize Lua.
*
* @author GSIO01
* @date 14.10.2013
*
* @return A qboolean indicating success of failure.
*/
qboolean G_Lua_Init(void);
/**
* @brief A Lua function call.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] vm If non-null, the virtual mashine.
* @param [in] func If non-null, the function.
* @param nargs Number of arguments.
* @param nresults Number of results.
*
* @return A qboolean indicating success or failure.
*/
qboolean G_Lua_Call(lvm_t* vm, char* func, int32_t nargs, int32_t nresults);
/**
* @brief Resume execution of a Lua vm.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] vm If non-null, the virtual mashine.
* @param [in] T If non-null, the lua_State * to process.
* @param [in] func If non-null, the function.
* @param nargs The nargs.
*
* @return A qboolean indicating success of failure.
*/
qboolean G_Lua_Resume(lvm_t* vm, lua_State* T, char* func, int32_t nargs);
/**
* @brief Get a Lua function.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] vm If non-null, the virtual mashine.
* @param [in] name If non-null, the name.
*
* @return A qboolean.
*/
qboolean G_Lua_GetFunction(lvm_t* vm, char* name);
/**
* @brief Start Lua VM.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] vm If non-null, the virtual mashine.
*
* @return A qboolean.
*/
qboolean G_Lua_StartVM(lvm_t* vm);
/**
* @brief Stop Lua VM.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] vm If non-null, the virtual mashine.
*/
void G_Lua_StopVM(lvm_t* vm);
/**
* @brief Shutdown Lua.
*
* @author GSIO01
* @date 14.10.2013
*/
void G_Lua_Shutdown(void);
/**
* @brief Print the lua status to a client console.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] ent If non-null, the client.
*/
void G_Lua_Status(gentity_t* ent);
/**
* @brief Get the lua VM for a given Lua state.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] L If non-null, the lua_State * to process.
*
* @return null if it fails, else a lvm_t*.
*/
lvm_t* G_Lua_GetVM(lua_State* L);
// lua_entity.c
typedef struct {
gentity_t *e;
} luaGentity_t;
/**
* @brief Open lua entity library.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] L If non-null, the lua_State * to process.
*
* @return An int.
*/
int32_t Luaopen_Entity(lua_State* L);
/**
* @brief Push an entity onto the lua stack.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] L If non-null, the lua_State * to process.
* @param [in] ent If non-null, the entity to push.
*/
void Lua_PushEntity(lua_State* L, gentity_t* ent);
/**
* @brief Get an entity from the lua stack.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] L If non-null, the lua_State * to process.
* @param argNum The argument which is the entity.
*
* @return null if it fails, else a lent_t*.
*/
luaGentity_t* Lua_GetEntity(lua_State* L, int32_t argNum);
/**
* @brief Open lua weapons library.
*
* @author GSIO01
* @date 14.10.2013
*
* @param [in] L If non-null, the lua_State * to process.
*
* @return An int.
*/
int32_t Luaopen_Weapons(lua_State* L);
// lua_trace.c
typedef struct {
trace_t *tr;
} luaTrace_t;
void Lua_PushTrace(lua_State* L, trace_t* tr);
luaTrace_t *Lua_GetTrace(lua_State* L, int32_t argNum);
int Luaopen_Trace(lua_State* L);
// lua_game.c
int32_t Luaopen_Game(lua_State* L);
// lua_qmath.c
int32_t Luaopen_Qmath(lua_State* L);
// lua_vector.c
int32_t Luaopen_Vector(lua_State* L);
void Lua_PushVector(lua_State* L, vec3_t v);
vec_t* Lua_GetVector(lua_State* L, int32_t argNum);
int32_t Lua_IsVector(lua_State* L, int32_t index);
vec3_t* Lua_GetVectorMisc(lua_State* L, int32_t* index);
// lua_mover.c
int32_t Luaopen_Mover(lua_State* L);
// lua_cinematic.c
int32_t Luaopen_Cinematic(lua_State* L);
// lua_sound.c
int32_t Luaopen_Sound(lua_State* L);
/**
* Lua hook for InitGame event.
*
* \param leveltime level time the event occured
* \param radomseed a random seed
* \param restart is this a map restart?
*/
void LuaHook_G_InitGame(int32_t leveltime, uint32_t randomseed, int32_t restart);
/**
* Lua hook for weapon firing.
*
* \param ent The player.
* \param muzzle The muzzle point.
* \param forwar The forward vector.
* \param alt_fire Indicator whether the shot is alternative fire mode.
* \param weapon Weapon number.
*/
void LuaHook_G_FireWeapon(int32_t ent, vec3_t muzzle, vec3_t forward, int32_t alt_fire, int32_t weapon);
/**
* Lua hook for Shutdown event.
*
* \param restart is this a map restart?
*/
void LuaHook_G_Shutdown(int32_t restart);
/**
* Lua hook for RunFrame event.
*
* \param leveltime the level time
*/
void LuaHook_G_RunFrame(int32_t leveltime);
/**
* Lua hook for G_Print function.
*
* \param text text to be printed
*/
void LuaHook_G_Print(char* text);
/**
* Lua hook for G_ClientPrint function.
*
* \param text text to be printed
* \param entnum entity index for client the text gets send to
*/
void LuaHook_G_ClientPrint(char* text, int32_t entnum);
/**
* Lua hook for entity think function function.
*
* \param function name of function to call
* \param entnum entity index of entity the think function was called on
* \return success or fail
*/
void LuaHook_G_EntityThink(char* function, int32_t entnum);
/**
* Lua hook for entity touch function function.
*
* \param function name of function to call
* \param entnum entity index of entity the touch function was called on
* \param othernum entiy index of touching entity
* \return success or fail
*/
void LuaHook_G_EntityTouch(char* function, int32_t entnum, int32_t othernum);
/**
* Lua hook for entity use function.
*
* \param function name of function to call
* \param entnum entity index of entity the use function was called on
* \param othernum entity index of other entity
* \param activatornum entity index of activating entity
*/
void LuaHook_G_EntityUse(char* function, int32_t entnum, int32_t othernum, int32_t activatornum);
/**
* Lua hook for entity hurt function.
*
* \param function name of function to call
* \param entnum entity index of entity the hurt function was called on
* \param inflictornum entity index of inflictor
* \param attackernum entity index of attacker
*/
void LuaHook_G_EntityHurt(char* function, int32_t entnum, int32_t inflictornum, int32_t attackernum);
/**
* Lua hook for entity die function.
*
* \param function name of function to call
* \param entnum entity index of entity the die function was called on
* \param inflictornum entity index of inflictor
* \param attackernum entity index of attacker
* \param dmg ammount of damage
* \param mod means of death
*/
void LuaHook_G_EntityDie(char* function, int32_t entnum, int32_t inflictornum, int32_t attackernum, int32_t dmg, int32_t mod);
/**
* Lua hook for entity free function.
*
* \param function name of function to call
* \param entnum entity index of entity the free function was called on
*/
void LuaHook_G_EntityFree(char* function, int32_t entnum);
/**
* Lua hook for entity trigger function.
*
* \param function name of function to call
* \param entnum entity index of entity the trigger function was called on
* \param othernum entity index of triggering entity
*/
void LuaHook_G_EntityTrigger(char* function, int32_t entnum, int32_t othernum);
/**
* Lua hook for entity spawn function.
*
* \param function name of function to call
* \param entnum entity index of entity the spawn function was called on
*/
void LuaHook_G_EntitySpawn(char* function, int32_t entnum);
/**
* Lua hook for entity reached function.
*
* \param function name of function to call
* \param entnum entity index of entity the reached function was called on
*/
void LuaHook_G_EntityReached(char* function, int32_t entnum);
/**
* Lua hook for entity reached angular function.
*
* \param function name of function to call
* \param entnum entity index of entity the reached angular function was called on
*/
void LuaHook_G_EntityReachedAngular(char* function, int32_t entnum);
/**
* \fn unsigned G_Lua_NumThreads(void);
*
* \brief Get information about lua threads.
*
* Prints status information about lua threads and returns the number of active lua threads.
*
* \author GSIO01
* \date 14.10.2013
*
* \return An unsigned.
*/
void LuaHook_G_CmdScriptCall(char* function);
unsigned G_Lua_NumThreads(void);
/**
* \fn void G_Lua_CollectGarbage(void);
*
* \brief Garbage collection of inactive lua threads.
*
* \author GSIO01
* \date 14.10.2013
*/
void G_Lua_CollectGarbage(void);
#endif

View file

@ -1,11 +1,11 @@
#ifndef G_MAIN_H
#define G_MAIN_H
#include "g_local.h"
extern int numKilled;
extern holoData_t holoData;
extern qboolean levelExiting;
extern mapChangeData_t mapChangeData;
#ifndef G_MAIN_H
#define G_MAIN_H
#include "g_local.h"
extern int32_t numKilled;
extern holoData_t holoData;
extern qboolean levelExiting;
extern mapChangeData_t mapChangeData;
#endif

View file

@ -22,9 +22,9 @@ typedef enum {
typedef struct
{
char* name;
int ofs;
int32_t ofs;
fieldtype_t type;
int flags;
int32_t flags;
} field_t;
/**
@ -455,7 +455,7 @@ qboolean G_SpawnFloat( const char* key, const char* defaultString, /*@out@*/ flo
* \param[out] out The result.
* \return Success or fail.
*/
qboolean G_SpawnInt( const char* key, const char* defaultString, /*@out@*/ int* out );
qboolean G_SpawnInt( const char* key, const char* defaultString, /*@out@*/ int32_t* out );
/**
* \brief Get a vector for a custom entity key.

View file

@ -1,110 +1,135 @@
#ifndef _G_SQL_H_
#define _G_SQL_H_
#define MAX_SQL_RESULT 4096
#define SQL_ENABLE_FOREIGN_KEY_CONSTRAINTS "PRAGMA foreign_keys = ON;"
#define SQL_BEGIN_TRANSACTION "BEGIN TRANSACTION"
#define SQL_ROLLBACK_TRANSACTION "ROLLBACK TRANSACTION"
#define SQL_COMMIT_TRANSACTION "COMMIT TRANSACTION"
#define SQL_USER_CREATEUSERTABLE "CREATE TABLE IF NOT EXISTS rpgx_users ( \
id INTEGER PRIMARY KEY AUTOINCREMENT, \
username TEXT NOT NULL , \
password TEXT NOT NULL \
)"
#define SQL_USER_CREATERIGHTSTABLE "CREATE TABLE IF NOT EXISTS rpgx_userRights ( \
id INT NOT NULL PRIMARY KEY, \
admin BIT NOT NULL, \
rights LONG NOT NULL, \
FOREIGN KEY(id) REFERENCES rpgx_users(id) \
)"
#define SQL_USER_DELETE "DELETE FROM rpgx_users WHERE username = :UNAME"
#define SQL_USER_DELTE_RIGHTS "DELETE FROM rpgx_userRights WHERE id = :ID"
#define SQL_USER_ADD "INSERT INTO rpgx_users VALUES(NULL,:USERNAME,:PASSWORD)"
#define SQL_USER_ADD_RIGHTS "INSERT INTO rpgx_userRights VALUES(:ID, 0, 0)"
#define SQL_USER_MOD_RIGHTS "UPDATE rpgx_userRights SET rights = :RIGHTS WHERE id = :ID"
#define SQL_USER_GET_RIGHTS "SELECT rights FROM rpgx_userRights WHERE id = :ID"
#define SQL_USER_CHECK_ADMIN "SELECT admin FROM rpgx_userRights WHERE id = :ID"
#define SQL_USER_GET_PASSWORD "SELECT password FROM rpgx_users WHERE id = :ID"
#define SQL_USER_SET_PASSWORD "UPDATE rpgx_users SET password = :PASSWORD WHERE id = :ID"
#define SQL_USER_GET_UID "SELECT id FROM rpgx_users WHERE username = :UNAME"
#define SQL_USER_LOGIN "SELECT id FROM rpgx_users WHERE username = :UNAME AND password = :PASSWORD"
#define SQL_STRING_CREATE_TABLE "CREATE TABLE IF NOT EXISTS rpgx_strings ( \
id INTEGER PRIMARY KEY AUTOINCREMENT, \
text TEXT NOT NULL, \
text_de TEXT NOT NULL, \
text_nl TEXT NOT NULL \
)"
/* Okay. I think this list is way too long and some things should be put together. Here is the original list for reference.
typedef enum {
SQLF_GIVE = 1,
SQLF_GOD = 2,
SQLF_NOCLIP = 4,
SQLF_CLOAK = 8,
SQLF_EVOSUIT = 16,
SQLF_FLIGHT = 32,
SQLF_FORCENAME = 64, //now SQLF_FORCEPARM = 64
SQLF_FORCEKILL = 128,
SQLF_KICK = 256,
SQLF_DRAG = 512,
SQLF_DISARM = 1024,
SQLF_FORCERANK = 2048, //now SQLF_FORCEPARM = 64
SQLF_REVIVE = 4096,
SQLF_NOOB = 8192,
SQLF_MESSAGE = 16384,
SQLF_FORCEMODEL = 32768, //now SQLF_FORCEPARM = 64
SQLF_MUSIC = 65536,
SQLF_SOUND = 131072, //now SQLF_MUSIC = 65536
SQLF_USEENT = 262144,
SQLF_BEAM = 524288,
SQLF_FORCEPLAYER = 1048576, //now SQLF_FORCEPARM = 64
SQLF_FX = 2097152,
SQLF_CHARS = 4194304,
SQLF_CLAMP = 8388608,
SQLF_LOCK = 16777216,
SQLF_FFSTUFF = 33554432,
SQLF_ALERT = 67108864,
SQLF_TESS = 134217728,
SQLF_FORCECLASS = 268435456, //now SQLF_FORCEPARM = 64
SQLF_FORCEVOTE = 536870912,
SQLF_SHAKE = 1073741824, //now SQLF_FX = 2097152
//SQLF_ENTLIST = 2147483648 // that is to big ... using SQLF_USEENT for entitylist as it makes sense
} sql_userflags;*/
typedef enum {
SQLF_GIVE = 1,
SQLF_GOD = 2,
SQLF_NOCLIP = 4,
SQLF_CLOAK = 8,
SQLF_EVOSUIT = 16,
SQLF_FLIGHT = 32,
SQLF_FORCEPARM = 64,
SQLF_FORCEKILL = 128,
SQLF_KICK = 256,
SQLF_DRAG = 512,
SQLF_DISARM = 1024,
SQLF_SMS = 2048, //Shiphealth, Selfdestruct and associated
SQLF_REVIVE = 4096,
SQLF_NOOB = 8192,
SQLF_MESSAGE = 16384,
SQLF_DEBUG = 32768, //Debugging Tools
SQLF_MUSIC = 65536,
//unused = 131072,
SQLF_USEENT = 262144,
SQLF_BEAM = 524288,
//unused = 1048576,
SQLF_FX = 2097152,
SQLF_CHARS = 4194304,
SQLF_CLAMP = 8388608,
SQLF_LOCK = 16777216,
SQLF_FFSTUFF = 33554432,
SQLF_ALERT = 67108864,
SQLF_TESS = 134217728,
//unused = 268435456,
SQLF_FORCEVOTE = 536870912
//unused = 1073741824
//Maximum Value
} sql_userflags;
#endif // _G_SQL_H_
#ifndef _G_SQL_H_
#define _G_SQL_H_
enum g_sqlLimits_e {
MAX_SQL_RESULT = 4096
};
static const char SQL_ENABLE_FOREIGN_KEY_CONSTRAINTS[] = "PRAGMA foreign_keys = ON;";
static const char SQL_BEGIN_TRANSACTION[] = "BEGIN TRANSACTION";
static const char SQL_ROLLBACK_TRANSACTION[] = "ROLLBACK TRANSACTION";
static const char SQL_COMMIT_TRANSACTION[] = "COMMIT TRANSACTION";
static const char SQL_USER_CREATEUSERTABLE[] = {
"CREATE TABLE IF NOT EXISTS rpgx_users ( "\
"id INTEGER PRIMARY KEY AUTOINCREMENT, "\
"username TEXT NOT NULL , "\
"password TEXT NOT NULL "\
")"
};
static const char SQL_USER_CREATERIGHTSTABLE[] = {
"CREATE TABLE IF NOT EXISTS rpgx_userRights ( "\
"id INT NOT NULL PRIMARY KEY, "\
"admin BIT NOT NULL, "\
"rights LONG NOT NULL, "\
"FOREIGN KEY(id) REFERENCES rpgx_users(id) "\
")"
};
static const char SQL_USER_DELETE[] = "DELETE FROM rpgx_users WHERE username = :UNAME";
static const char SQL_USER_DELTE_RIGHTS[] = "DELETE FROM rpgx_userRights WHERE id = :ID";
static const char SQL_USER_ADD[] = "INSERT INTO rpgx_users VALUES(NULL,:USERNAME,:PASSWORD)";
static const char SQL_USER_ADD_RIGHTS[] = "INSERT INTO rpgx_userRights VALUES(:ID, 0, 0)";
static const char SQL_USER_MOD_RIGHTS[] = "UPDATE rpgx_userRights SET rights = :RIGHTS WHERE id = :ID";
static const char SQL_USER_GET_RIGHTS[] = "SELECT rights FROM rpgx_userRights WHERE id = :ID";
static const char SQL_USER_CHECK_ADMIN[] = "SELECT admin FROM rpgx_userRights WHERE id = :ID";
static const char SQL_USER_GET_PASSWORD[] = "SELECT password FROM rpgx_users WHERE id = :ID";
static const char SQL_USER_SET_PASSWORD[] = "UPDATE rpgx_users SET password = :PASSWORD WHERE id = :ID";
static const char SQL_USER_GET_UID[] = "SELECT id FROM rpgx_users WHERE username = :UNAME";
static const char SQL_USER_LOGIN[] = "SELECT id FROM rpgx_users WHERE username = :UNAME AND password = :PASSWORD";
static const char SQL_STRING_CREATE_TABLE[] = {
"CREATE TABLE IF NOT EXISTS rpgx_strings ( "\
"id INTEGER PRIMARY KEY AUTOINCREMENT, "\
"text TEXT NOT NULL, "\
"text_de TEXT NOT NULL, "\
"text_nl TEXT NOT NULL "\
")"
};
/* Okay. I think this list is way too long and some things should be put together. Here is the original list for reference.
typedef enum {
SQLF_GIVE = 1,
SQLF_GOD = 2,
SQLF_NOCLIP = 4,
SQLF_CLOAK = 8,
SQLF_EVOSUIT = 16,
SQLF_FLIGHT = 32,
SQLF_FORCENAME = 64, //now SQLF_FORCEPARM = 64
SQLF_FORCEKILL = 128,
SQLF_KICK = 256,
SQLF_DRAG = 512,
SQLF_DISARM = 1024,
SQLF_FORCERANK = 2048, //now SQLF_FORCEPARM = 64
SQLF_REVIVE = 4096,
SQLF_NOOB = 8192,
SQLF_MESSAGE = 16384,
SQLF_FORCEMODEL = 32768, //now SQLF_FORCEPARM = 64
SQLF_MUSIC = 65536,
SQLF_SOUND = 131072, //now SQLF_MUSIC = 65536
SQLF_USEENT = 262144,
SQLF_BEAM = 524288,
SQLF_FORCEPLAYER = 1048576, //now SQLF_FORCEPARM = 64
SQLF_FX = 2097152,
SQLF_CHARS = 4194304,
SQLF_CLAMP = 8388608,
SQLF_LOCK = 16777216,
SQLF_FFSTUFF = 33554432,
SQLF_ALERT = 67108864,
SQLF_TESS = 134217728,
SQLF_FORCECLASS = 268435456, //now SQLF_FORCEPARM = 64
SQLF_FORCEVOTE = 536870912,
SQLF_SHAKE = 1073741824, //now SQLF_FX = 2097152
//SQLF_ENTLIST = 2147483648 // that is to big ... using SQLF_USEENT for entitylist as it makes sense
} sql_userflags;*/
typedef enum {
SQLF_GIVE = 1,
SQLF_GOD = 2,
SQLF_NOCLIP = 4,
SQLF_CLOAK = 8,
SQLF_EVOSUIT = 16,
SQLF_FLIGHT = 32,
SQLF_FORCEPARM = 64,
SQLF_FORCEKILL = 128,
SQLF_KICK = 256,
SQLF_DRAG = 512,
SQLF_DISARM = 1024,
SQLF_SMS = 2048, //Shiphealth, Selfdestruct and associated
SQLF_REVIVE = 4096,
SQLF_NOOB = 8192,
SQLF_MESSAGE = 16384,
SQLF_DEBUG = 32768, //Debugging Tools
SQLF_MUSIC = 65536,
//unused = 131072,
SQLF_USEENT = 262144,
SQLF_BEAM = 524288,
//unused = 1048576,
SQLF_FX = 2097152,
SQLF_CHARS = 4194304,
SQLF_CLAMP = 8388608,
SQLF_LOCK = 16777216,
SQLF_FFSTUFF = 33554432,
SQLF_ALERT = 67108864,
SQLF_TESS = 134217728,
//unused = 268435456,
SQLF_FORCEVOTE = 536870912
//unused = 1073741824
//Maximum Value
} sql_userflags;
#endif // _G_SQL_H_

View file

@ -5,9 +5,9 @@
#define G_TEAM_H_
// Prototypes
const char *TeamName(int team);
const char *OtherTeamName(int team);
const char *TeamColorString(int team);
const char* TeamName(int32_t team);
const char* OtherTeamName(int32_t team);
const char* TeamColorString(int32_t team);
#endif /* G_TEAM_H_ */

View file

@ -4,110 +4,115 @@
#ifndef INV_H_
#define INV_H_
#define INVENTORY_NONE 0
enum inventory_e {
INVENTORY_NONE,
//armor
#define INVENTORY_ARMOR 1
//armor
INVENTORY_ARMOR,
//weapons
//weapons
#define INVENTORY_GRENADELAUNCHER 2
#define INVENTORY_STASIS 3
#define INVENTORY_PHASER 4
#define INVENTORY_DREADNOUGHT 5
#define INVENTORY_IMOD 6
#define INVENTORY_COMPRESSION 7
#define INVENTORY_TETRION 8
#define INVENTORY_SCAVENGER 9
#define INVENTORY_QUANTUM 10
INVENTORY_GRENADELAUNCHER,
INVENTORY_STASIS,
INVENTORY_PHASER,
INVENTORY_DREADNOUGHT,
INVENTORY_IMOD,
INVENTORY_COMPRESSION,
INVENTORY_TETRION,
INVENTORY_SCAVENGER,
INVENTORY_QUANTUM,
//ammo
//ammo
#define INVENTORY_GRENADES 11
#define INVENTORY_STASISAMMO 12
#define INVENTORY_PHASERAMMO 13 //!< not a pickup but perhaps useful for bots
#define INVENTORY_DREADNOUGHTAMMO 14
#define INVENTORY_IMODAMMO 15
#define INVENTORY_COMPRESSIONAMMO 16
#define INVENTORY_TETRIONAMMO 17
#define INVENTORY_SCAVENGERAMMO 18
#define INVENTORY_QUANTUMAMMO 19
INVENTORY_GRENADES,
INVENTORY_STASISAMMO,
INVENTORY_PHASERAMMO, //!< not a pickup but perhaps useful for bots
INVENTORY_DREADNOUGHTAMMO,
INVENTORY_IMODAMMO,
INVENTORY_COMPRESSIONAMMO,
INVENTORY_TETRIONAMMO,
INVENTORY_SCAVENGERAMMO,
INVENTORY_QUANTUMAMMO,
//powerups
#define INVENTORY_HEALTH 24
#define INVENTORY_TRANSPORTER 25
#define INVENTORY_MEDKIT 26
#define INVENTORY_QUAD 27
#define INVENTORY_ENVIRONMENTSUIT 28
#define INVENTORY_HASTE 29
#define INVENTORY_INVISIBILITY 30
#define INVENTORY_REGEN 31
#define INVENTORY_FLIGHT 32
#define INVENTORY_REDFLAG 33
#define INVENTORY_BLUEFLAG 34
#define INVENTORY_DETPACK 35
#define INVENTORY_SEEKER 36
#define INVENTORY_SHIELD 37
#define INVENTORY_DECOY 38 //!< decoy temp
#define INVENTORY_DETPACK_PLACED 39
//powerups
INVENTORY_HEALTH = 24,
INVENTORY_TRANSPORTER,
INVENTORY_MEDKIT,
INVENTORY_QUAD,
INVENTORY_ENVIRONMENTSUIT,
INVENTORY_HASTE,
INVENTORY_INVISIBILITY,
INVENTORY_REGEN,
INVENTORY_FLIGHT,
INVENTORY_REDFLAG,
INVENTORY_BLUEFLAG,
INVENTORY_DETPACK,
INVENTORY_SEEKER,
INVENTORY_SHIELD,
INVENTORY_DECOY, //!< decoy temp
INVENTORY_DETPACK_PLACED,
#define INVENTORY_HYPO 40
#define INVENTORY_ASSIMILATOR 41
#define INVENTORY_BORG_WEAPON 42
INVENTORY_HYPO,
INVENTORY_ASSIMILATOR,
INVENTORY_BORG_WEAPON,
//enemy stuff
#define ENEMY_HORIZONTAL_DIST 200
#define ENEMY_HEIGHT 201
#define NUM_VISIBLE_ENEMIES 202
#define NUM_VISIBLE_TEAMMATES 203
//enemy stuff
ENEMY_HORIZONTAL_DIST = 200,
ENEMY_HEIGHT,
NUM_VISIBLE_ENEMIES,
NUM_VISIBLE_TEAMMATES
};
//item numbers (make sure they are in sync with bg_itemlist in bg_misc.c)
// ALSO: make sure this list is the same as the one in \botfiles\inv.h
#define MODELINDEX_NONE 0
enum modelIndices_e {
MODELINDEX_NONE,
#define MODELINDEX_PHASER 1
#define MODELINDEX_COMPRESSION 2
#define MODELINDEX_IMOD 3
#define MODELINDEX_SCAVENGER 4
#define MODELINDEX_STASISWEAPON 5
#define MODELINDEX_GRENADELAUNCHER 6
#define MODELINDEX_TETRION 7
#define MODELINDEX_QUANTUM 8
#define MODELINDEX_DREADNOUGHT 9
MODELINDEX_PHASER,
MODELINDEX_COMPRESSION,
MODELINDEX_IMOD,
MODELINDEX_SCAVENGER,
MODELINDEX_STASISWEAPON,
MODELINDEX_GRENADELAUNCHER,
MODELINDEX_TETRION,
MODELINDEX_QUANTUM,
MODELINDEX_DREADNOUGHT,
#define MODELINDEX_COMPRESSIONAMMO 10
#define MODELINDEX_IMODAMMO 11
#define MODELINDEX_SCAVAMMO 12
#define MODELINDEX_STASISAMMO 13
#define MODELINDEX_GRENADES 14
#define MODELINDEX_TETRIONAMMO 15
#define MODELINDEX_QUANTUMAMMO 16
#define MODELINDEX_DREADNOUGHTAMMO 17
MODELINDEX_COMPRESSIONAMMO,
MODELINDEX_IMODAMMO,
MODELINDEX_SCAVAMMO,
MODELINDEX_STASISAMMO,
MODELINDEX_GRENADES,
MODELINDEX_TETRIONAMMO,
MODELINDEX_QUANTUMAMMO,
MODELINDEX_DREADNOUGHTAMMO,
#define MODELINDEX_ARMORSHARD 18
#define MODELINDEX_ARMORCOMBAT 19
#define MODELINDEX_ARMORBODY 20
#define MODELINDEX_HEALTHSMALL 21
#define MODELINDEX_HEALTH 22
MODELINDEX_ARMORSHARD,
MODELINDEX_ARMORCOMBAT,
MODELINDEX_ARMORBODY,
MODELINDEX_HEALTHSMALL,
MODELINDEX_HEALTH,
#define MODELINDEX_TELEPORTER 23
#define MODELINDEX_MEDKIT 24
#define MODELINDEX_QUAD 25
#define MODELINDEX_ENVIRONMENTSUIT 26
#define MODELINDEX_HASTE 27
#define MODELINDEX_INVISIBILITY 28
#define MODELINDEX_REGEN 29
#define MODELINDEX_FLIGHT 30
#define MODELINDEX_REDFLAG 31
#define MODELINDEX_BLUEFLAG 32
#define MODELINDEX_DETPACK 33
#define MODELINDEX_SEEKER 34
#define MODELINDEX_SHIELD 35
#define MODELINDEX_DECOY 36 //!< decoy temp
MODELINDEX_TELEPORTER,
MODELINDEX_MEDKIT,
MODELINDEX_QUAD,
MODELINDEX_ENVIRONMENTSUIT,
MODELINDEX_HASTE,
MODELINDEX_INVISIBILITY,
MODELINDEX_REGEN,
MODELINDEX_FLIGHT,
MODELINDEX_REDFLAG,
MODELINDEX_BLUEFLAG,
MODELINDEX_DETPACK,
MODELINDEX_SEEKER,
MODELINDEX_SHIELD,
MODELINDEX_DECOY, //!< decoy temp
MODELINDEX_HYPO,
MODELINDEX_ASSIMILATOR,
MODELINDEX_BORG_WEAPON
};
#define MODELINDEX_HYPO 37
#define MODELINDEX_ASSIMILATOR 38
#define MODELINDEX_BORG_WEAPON 39
#endif /* INV_H_ */

View file

@ -1,75 +1,75 @@
// cinematic lib for lua
#include "g_lua.h"
#include "g_cinematic.h"
#ifdef G_LUA
/***
A library for cinematics. Not finished and therfore not further documented.
@module cinematic
*/
// cinematic.Activate(entity ent, entity target)
// Activates Camera on ent and points it at target.
static int Cinematic_Activate(lua_State *L) {
lent_t *ent;
lent_t *target;
ent = Lua_GetEntity(L, 1);
if(!ent) return 0;
target = Lua_GetEntity(L, 2);
if(!target) return 0;
Cinematic_ActivateCameraMode(ent->e, target->e);
return 0;
}
// cinematic.Deactivate(entity ent)
// Deactivates camera on ent.
static int Cinematic_Deactivate(lua_State *L) {
lent_t *ent;
ent = Lua_GetEntity(L, 1);
if(!ent) return 0;
Cinematic_DeactivateCameraMode(ent->e);
return 0;
}
// cinematic.ActivateGlobal(entity target)
// Activates broadcasting of target.
static int Cinematic_ActivateGlobal(lua_State *L) {
lent_t *target;
target = Lua_GetEntity(L, 2);
if(!target) return 0;
Cinematic_ActivateGlobalCameraMode(target->e);
return 0;
}
// cinematic.DeactivateGlobal()
// Deactivates broadcasting.
static int Cinematic_DeactivateGlobal(lua_State *L) {
Cinematic_DeactivateGlobalCameraMode();
return 0;
}
static const luaL_Reg lib_cinematic[] = {
{ "Activate", Cinematic_Activate },
{ "Deactivate", Cinematic_Deactivate },
{ "ActivateGlobal", Cinematic_ActivateGlobal },
{ "DeactivateGlobal", Cinematic_DeactivateGlobal },
{ NULL, NULL }
};
int Luaopen_Cinematic(lua_State *L) {
luaL_register(L, "cinematic", lib_cinematic);
return 1;
}
#endif //G_LUA
// cinematic lib for lua
#include "g_lua.h"
#include "g_cinematic.h"
#ifdef G_LUA
/***
A library for cinematics. Not finished and therfore not further documented.
@module cinematic
*/
// cinematic.Activate(entity ent, entity target)
// Activates Camera on ent and points it at target.
static int Cinematic_Activate(lua_State *L) {
luaGentity_t *ent;
luaGentity_t *target;
ent = Lua_GetEntity(L, 1);
if(!ent) return 0;
target = Lua_GetEntity(L, 2);
if(!target) return 0;
Cinematic_ActivateCameraMode(ent->e, target->e);
return 0;
}
// cinematic.Deactivate(entity ent)
// Deactivates camera on ent.
static int Cinematic_Deactivate(lua_State *L) {
luaGentity_t *ent;
ent = Lua_GetEntity(L, 1);
if(!ent) return 0;
Cinematic_DeactivateCameraMode(ent->e);
return 0;
}
// cinematic.ActivateGlobal(entity target)
// Activates broadcasting of target.
static int Cinematic_ActivateGlobal(lua_State *L) {
luaGentity_t *target;
target = Lua_GetEntity(L, 2);
if(!target) return 0;
Cinematic_ActivateGlobalCameraMode(target->e);
return 0;
}
// cinematic.DeactivateGlobal()
// Deactivates broadcasting.
static int Cinematic_DeactivateGlobal(lua_State *L) {
Cinematic_DeactivateGlobalCameraMode();
return 0;
}
static const luaL_Reg lib_cinematic[] = {
{ "Activate", Cinematic_Activate },
{ "Deactivate", Cinematic_Deactivate },
{ "ActivateGlobal", Cinematic_ActivateGlobal },
{ "DeactivateGlobal", Cinematic_DeactivateGlobal },
{ NULL, NULL }
};
int Luaopen_Cinematic(lua_State *L) {
luaL_register(L, "cinematic", lib_cinematic);
return 1;
}
#endif //G_LUA

File diff suppressed because it is too large Load diff

View file

@ -386,7 +386,7 @@ Damage and player or entity.
@return Success or fail.
*/
static int Game_Damage(lua_State *L) {
lent_t *lent;
luaGentity_t *lent;
gentity_t *targ = NULL, *inflictor = NULL, *attacker = NULL;
vec_t *dir = NULL, *point = NULL;
int damage = 0, dflags = 0, mod = 0;
@ -437,7 +437,7 @@ Repair an entity.
@return Success or fail.
*/
static int Game_Repair(lua_State *L) {
lent_t *lent;
luaGentity_t *lent;
float rate;
LUA_DEBUG("BEGIN - game.Repair");

View file

@ -18,7 +18,7 @@ Stops translational movement on ent immediately.
@return Success or failure.
*/
static int Mover_Halt(lua_State *L) {
lent_t *lent;
luaGentity_t *lent;
gentity_t *ent = NULL;
int id = 0;
@ -64,7 +64,7 @@ Stops rotational movement on ent immediately.
*/
static int Mover_HaltAngles(lua_State * L)
{
lent_t *lent;
luaGentity_t *lent;
gentity_t *ent = NULL;
int id = 0;
@ -116,7 +116,7 @@ Moves an entity like a func_train entity. Targets have to be path_corner entitie
*/
static int Mover_AsTrain(lua_State * L)
{
lent_t *lent, *tlent;
luaGentity_t *lent, *tlent;
gentity_t *ent = NULL;
gentity_t *targ = NULL;
vec3_t move;
@ -237,7 +237,7 @@ Sets the angles of ent to the specified value.
static int Mover_SetAngles(lua_State * L)
{
vec3_t newAngles;
lent_t *lent;
luaGentity_t *lent;
gentity_t *ent = NULL;
vec_t *target;
int id = 0;
@ -304,7 +304,7 @@ Sets the angles of ent to the specified value.
static int Mover_SetAngles2(lua_State * L)
{
vec3_t newAngles;
lent_t *lent;
luaGentity_t *lent;
gentity_t *ent = NULL;
vec_t *target;
int id = 0;
@ -371,7 +371,7 @@ Set the position of ent to the specified value.
static int Mover_SetPosition(lua_State * L)
{
vec3_t newOrigin;
lent_t *lent;
luaGentity_t *lent;
gentity_t *ent = NULL;
vec_t *target;
int id = 0;
@ -455,7 +455,7 @@ Rotates ent with a given speed (in degrees per second) to the specified values.
static int Mover_ToAngles(lua_State * L)
{
vec3_t newAngles;
lent_t *lent;
luaGentity_t *lent;
gentity_t *ent = NULL;
float speed;
vec_t *target;
@ -521,7 +521,7 @@ Moves ent with a given speed to the specified values. Can also be stowed in a ve
static int Mover_ToPosition(lua_State * L)
{
vec3_t newOrigin;
lent_t *lent;
luaGentity_t *lent;
gentity_t *ent = NULL;
float speed;
vec_t *target;

View file

@ -21,7 +21,7 @@ static int Sound_PlaySound(lua_State *L) {
char *sound;
int snd;
int chan;
lent_t *l;
luaGentity_t *l;
l = Lua_GetEntity(L,1);
if(!l || !l->e) return 1;

View file

@ -19,7 +19,7 @@ static int Trace_GC(lua_State * L)
static int Trace_ToString(lua_State * L)
{
ltrace_t *ltrace;
luaTrace_t *ltrace;
trace_t *trace;
char buf[MAX_STRING_CHARS];
@ -83,7 +83,7 @@ Frees all memory that was allocated for this trace.
@param trace The trace.
*/
static int Trace_FreeTrace(lua_State *L) {
ltrace_t *tr;
luaTrace_t *tr;
tr = Lua_GetTrace(L, 1);
if(tr && tr->tr)
@ -98,7 +98,7 @@ Check whether the trace has gone only trough solid content (e.g. only inside a w
@return Whether trace was all solid.
*/
static int Trace_GetAllsolid(lua_State *L) {
ltrace_t *tr;
luaTrace_t *tr;
tr = Lua_GetTrace(L, 1);
lua_pushboolean(L, (int)tr->tr->allsolid);
@ -112,7 +112,7 @@ Check whether the trace has started in solid contents.
@return Whether trace started solid.
*/
static int Trace_GetStartsolid(lua_State *L) {
ltrace_t *tr;
luaTrace_t *tr;
tr = Lua_GetTrace(L, 1);
lua_pushboolean(L, (int)tr->tr->startsolid);
@ -126,7 +126,7 @@ Get fraction of trace.
@return Fraction.
*/
static int Trace_GetFraction(lua_State *L) {
ltrace_t *tr;
luaTrace_t *tr;
tr = Lua_GetTrace(L, 1);
lua_pushnumber(L, tr->tr->fraction);
@ -140,7 +140,7 @@ Get end position of the trace.
@return End position of the trace.
*/
static int Trace_GetEndpos(lua_State *L) {
ltrace_t *tr;
luaTrace_t *tr;
tr = Lua_GetTrace(L, 1);
Lua_PushVector(L, tr->tr->endpos);
@ -154,7 +154,7 @@ Get the surface flags for the face the trace hit.
@return Surface flags.
*/
static int Trace_GetSurfaceFlags(lua_State *L) {
ltrace_t *tr;
luaTrace_t *tr;
tr = Lua_GetTrace(L, 1);
lua_pushnumber(L, tr->tr->surfaceFlags);
@ -168,7 +168,7 @@ Get content flags for the trace.
@return Content flags.
*/
static int Trace_GetContents(lua_State *L) {
ltrace_t *tr;
luaTrace_t *tr;
tr = Lua_GetTrace(L, 1);
lua_pushnumber(L, tr->tr->contents);
@ -182,7 +182,7 @@ Get entity number for entity the trace hit.
@return Entity number.
*/
static int Trace_GetEntityNum(lua_State *L) {
ltrace_t *tr;
luaTrace_t *tr;
tr = Lua_GetTrace(L, 1);
lua_pushnumber(L, tr->tr->entityNum);
@ -196,7 +196,7 @@ Get entity the trace hit.
@return entity the trace hit.
*/
static int Trace_GetEntity(lua_State *L) {
ltrace_t *tr;
luaTrace_t *tr;
gentity_t *ent;
tr = Lua_GetTrace(L, 1);
@ -280,9 +280,9 @@ int Luaopen_Trace(lua_State *L) {
void Lua_PushTrace(lua_State * L, trace_t * tr)
{
ltrace_t *trace;
luaTrace_t *trace;
trace = (ltrace_t *)lua_newuserdata(L, sizeof(ltrace_t));
trace = (luaTrace_t *)lua_newuserdata(L, sizeof(luaTrace_t));
luaL_getmetatable(L, "game.trace");
lua_setmetatable(L, -2);
@ -290,12 +290,12 @@ void Lua_PushTrace(lua_State * L, trace_t * tr)
trace->tr = tr;
}
ltrace_t *Lua_GetTrace(lua_State * L, int argNum)
luaTrace_t *Lua_GetTrace(lua_State * L, int argNum)
{
void *ud;
ud = luaL_checkudata(L, argNum, "game.trace");
luaL_argcheck(L, ud != NULL, argNum, "\'trace\' expected");
return (ltrace_t *) ud;
return (luaTrace_t *) ud;
}
#endif

View file

@ -70,7 +70,7 @@ Do damage to an entity.
@return Success or failure.
*/
static int weapon_Damage(lua_State *L) {
lent_t* lent;
luaGentity_t* lent;
gentity_t* target = NULL;
gentity_t* inflictor = NULL;
gentity_t* attacker = NULL;

View file

@ -1,10 +1,10 @@
// Current version of holomatch game
#ifndef STV_VERSION_H_
#define STV_VERSION_H_
#define Q3_VERSION "RPG-X V 2.4.1ua"
#endif /* STV_VERSION_H_ */
// end
// Current version of holomatch game
#ifndef STV_VERSION_H_
#define STV_VERSION_H_
static const char Q3_VERSION[] = "RPG-X V 2.4.1ua";
#endif /* STV_VERSION_H_ */
// end