cp_employee.h File Reference

Header for employee related stuff. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  employee_s

Defines

#define MAX_EMPLOYEES   512
#define E_IsHired(employee)   ((employee)->baseHired != NULL)

Typedefs

typedef struct employee_s employee_t

Enumerations

enum  employeeType_t {
  EMPL_SOLDIER, EMPL_SCIENTIST, EMPL_WORKER, EMPL_PILOT,
  EMPL_ROBOT, MAX_EMPL
}
 

The types of employees.

More...

Functions

void E_InitStartup (void)
 This is more or less the initial Bind some of the functions in this file to console-commands that you can call ingame. Called from UI_InitStartup resp. CL_InitLocal.
void E_ResetEmployees (void)
 Clears the employees list for loaded and new games.
employee_tE_GetNext (employeeType_t type, employee_t *lastEmployee)
 Iterates through employees.
employee_tE_GetNextFromBase (employeeType_t type, employee_t *lastEmployee, const base_t *base)
 Iterates through employees on a base.
employee_tE_GetNextHired (employeeType_t type, employee_t *lastEmployee)
 Iterates through hired employees.
employee_tE_CreateEmployee (employeeType_t type, struct nation_s *nation, const struct ugv_s *ugvType)
qboolean E_DeleteEmployee (employee_t *employee, employeeType_t type)
 Removes the employee completely from the game (buildings + global list).
qboolean E_HireEmployee (base_t *base, employee_t *employee)
 Hires the employee in a base.
qboolean E_HireEmployeeByType (base_t *base, employeeType_t type)
 Hires the first free employee of that type.
qboolean E_HireRobot (base_t *base, const struct ugv_s *ugvType)
qboolean E_UnhireEmployee (employee_t *employee)
 Fires an employee.
void E_RefreshUnhiredEmployeeGlobalList (const employeeType_t type, const qboolean excludeUnhappyNations)
 Recreates all the employees for a particular employee type in the global list. But it does not overwrite any employees already hired.
qboolean E_RemoveEmployeeFromBuildingOrAircraft (employee_t *employee)
 Remove one employee from building.
void E_ResetEmployee (employee_t *employee)
 Removes the inventory of the employee and also removes him from buildings.
int E_GenerateHiredEmployeesList (const base_t *base)
 Fill employeeList with a list of employees in the current base (i.e. they are hired and not transferred).
qboolean E_IsAwayFromBase (const employee_t *employee)
 Tells you if a employee is away from his home base (gone in mission).
employeeType_t E_GetEmployeeType (const char *type)
 Convert string to employeeType_t.
const char * E_GetEmployeeString (employeeType_t type)
 Convert employeeType_t to translated string.
employee_tE_GetEmployee (const base_t *const base, employeeType_t type, int num)
 Return a given employee pointer in the given base of a given type. Also returns those employees, that are not yet hired.
employee_tE_GetUnhiredRobot (const struct ugv_s *ugvType)
int E_GetHiredEmployees (const base_t *const base, employeeType_t type, linkedList_t **hiredEmployees)
 Return a list of hired employees in the given base of a given type.
employee_tE_GetHiredRobot (const base_t *const base, const struct ugv_s *ugvType)
employee_tE_GetUnassignedEmployee (const base_t *const base, employeeType_t type)
 Gets an assigned employee of a given type from the given base.
employee_tE_GetAssignedEmployee (const base_t *const base, employeeType_t type)
 Gets an unassigned employee of a given type from the given base.
employee_tE_GetHiredEmployeeByUcn (const base_t *const base, employeeType_t type, int ucn)
employee_tE_GetEmployeeFromChrUCN (int ucn)
 Searches all employee for the ucn (character id).
qboolean E_MoveIntoNewBase (employee_t *employee, base_t *newBase)
int E_CountHired (const base_t *const base, employeeType_t type)
 Counts hired employees of a given type in a given base.
int E_CountHiredRobotByType (const base_t *const base, const struct ugv_s *ugvType)
int E_CountAllHired (const base_t *const base)
 Counts all hired employees of a given base.
int E_CountUnhired (employeeType_t type)
 Counts unhired employees of a given type in a given base.
int E_CountUnhiredRobotsByType (const struct ugv_s *ugvType)
int E_CountUnassigned (const base_t *const base, employeeType_t type)
 Counts unassigned employees of a given type in a given base.
employee_tE_GetEmployeeByMenuIndex (int num)
 Find an hired or free employee by the menu index.
void E_UnhireAllEmployees (base_t *base, employeeType_t type)
 Reset the hired flag for all employees of a given type in a given base.
void E_DeleteAllEmployees (base_t *base)
 Removes all employees completely from the game (buildings + global list) from a given base.
void E_DeleteEmployeesExceedingCapacity (base_t *base)
 Removes employee until all employees fit in quarters capacity.
qboolean E_IsInBase (const employee_t *empl, const base_t *const base)
 Checks whether the given employee is in the given base.
void E_HireForBuilding (base_t *base, building_t *building, int num)
 Hires some employees of appropriate type for a building.
void E_InitialEmployees (void)
void E_Init (void)
void E_RemoveInventoryFromStorage (employee_t *employee)
 Removes the items of an employee (soldier) from the base storage (s)he is hired at.

Detailed Description

Header for employee related stuff.

Definition in file cp_employee.h.


Define Documentation

#define E_IsHired ( employee   )     ((employee)->baseHired != NULL)
#define MAX_EMPLOYEES   512

Typedef Documentation

typedef struct employee_s employee_t

The definition of an employee


Enumeration Type Documentation

The types of employees.

Todo:
MAX_EMPLOYEES_IN_BUILDING should be redefined by a config variable that is lab/workshop/quarters-specific, e.g.:
 if (!maxEmployeesInQuarter) maxEmployeesInQuarter = MAX_EMPLOYEES_IN_BUILDING;
 if (!maxEmployeesWorkersInLab) maxEmployeesWorkersInLab = MAX_EMPLOYEES_IN_BUILDING;
 if (!maxEmployeesInWorkshop) maxEmployeesInWorkshop = MAX_EMPLOYEES_IN_BUILDING;
Enumerator:
EMPL_SOLDIER 
EMPL_SCIENTIST 
EMPL_WORKER 
EMPL_PILOT 
EMPL_ROBOT 
MAX_EMPL 

For counting over all available enums.

Definition at line 49 of file cp_employee.h.


Function Documentation

int E_CountAllHired ( const base_t *const   base  ) 

Counts all hired employees of a given base.

Parameters:
[in] base The base where we count
Returns:
count of hired employees of a given type in a given base
Note:
must not return 0 if hasBuilding[B_QUARTER] is qfalse: used to update capacity
Todo:
What about EMPL_ROBOT?

Definition at line 1064 of file cp_employee.c.

References count, E_CountHired(), MAX_EMPL, and type.

Referenced by B_ResetAllStatusAndCapacities(), and E_UpdateGUICount_f().

int E_CountHired ( const base_t *const   base,
employeeType_t  type 
)

Counts hired employees of a given type in a given base.

Parameters:
[in] base The base where we count (NULL to count all).
[in] type The type of employee to search.
Returns:
count of hired employees of a given type in a given base

Definition at line 1026 of file cp_employee.c.

References count, E_GetNextHired(), and E_IsInBase().

Referenced by B_CheckBuildingStatusForMenu_f(), B_RemoveItemsExceedingCapacity(), B_UpdateStorageCap(), BaseSummary_Init(), CL_ActorPilotSelect_f(), CL_ActorTeamSelect_f(), CL_AssignPilot_f(), CL_AssignSoldier_f(), CL_EquipSoldierState(), E_CountAllHired(), E_UpdateGUICount_f(), PR_CalculateProductionPercentDone(), PR_ProductionAllowed(), PR_ProductionList_f(), PR_QueueNew(), PR_UpdateProductionCap(), RS_ResearchAllowed(), RS_UpdateInfo(), TR_CargoListSelect_f(), and TR_TransferListSelect_f().

int E_CountHiredRobotByType ( const base_t *const   base,
const struct ugv_s ugvType 
)
int E_CountUnassigned ( const base_t *const   base,
employeeType_t  type 
)

Counts unassigned employees of a given type in a given base.

Parameters:
[in] type The type of employee to search.
[in] base The base where we count

Definition at line 1117 of file cp_employee.c.

References employee_s::building, count, and E_GetNextFromBase().

Referenced by RS_InitGUI(), and RS_UpdateInfo().

int E_CountUnhired ( employeeType_t  type  ) 

Counts unhired employees of a given type in a given base.

Parameters:
[in] type The type of employee to search.
Returns:
count of hired employees of a given type in a given base

Definition at line 1084 of file cp_employee.c.

References count, E_GetNext(), and E_IsHired.

int E_CountUnhiredRobotsByType ( const struct ugv_s ugvType  ) 
employee_t* E_CreateEmployee ( employeeType_t  type,
struct nation_s nation,
const struct ugv_s ugvType 
)
void E_DeleteAllEmployees ( base_t base  ) 

Removes all employees completely from the game (buildings + global list) from a given base.

Note:
Used if the base e.g is destroyed by the aliens.
Parameters:
[in] base Which base the employee should be fired from.

Definition at line 851 of file cp_employee.c.

References employee_s::baseHired, ccs, Com_DPrintf(), DEBUG_CLIENT, E_DeleteEmployee(), E_IsInBase(), EMPL_SOLDIER, ccs_s::employees, i, MAX_EMPL, ccs_s::numEmployees, and type.

qboolean E_DeleteEmployee ( employee_t employee,
employeeType_t  type 
)

Removes the employee completely from the game (buildings + global list).

Parameters:
[in] employee The pointer to the employee you want to remove.
[in] type What type of employee to delete.
Returns:
True if the employee was removed successfully, otherwise false.
See also:
E_CreateEmployee
E_ResetEmployees
E_UnhireEmployee
Note:
This function has the side effect, that the global employee number for the given employee type is reduced by one, also the ccs.employees pointers are moved to fill the gap of the removed employee. Thus pointers like acTeam in the aircraft can point to wrong employees now. This has to be taken into account

Todo:
remove this once the employees are a linked list, too
Todo:
This might not work as expected - maybe we have to memmove the array

Definition at line 762 of file cp_employee.c.

References aircraft_s::acTeam, transfer_s::active, AIR_GetNextFromBase(), B_GetFoundedBaseByIDX(), employee_s::baseHired, ccs, Com_DPrintf(), linkedList_s::data, DEBUG_CLIENT, E_UnhireEmployee(), EMPL_PILOT, transfer_s::employeeArray, ccs_s::employees, i, employee_s::idx, MAX_BASES, MAX_EMPL, MAX_EMPLOYEES, linkedList_s::next, ccs_s::numEmployees, ccs_s::numTransfers, aircraft_s::pilot, qfalse, qtrue, employee_s::transfer, ccs_s::transfers, and employee_s::type.

Referenced by AIR_DestroyAircraft(), B_RemoveItemsExceedingCapacity(), CP_MissionEnd(), CP_SpawnRescueMission(), E_DeleteAllEmployees(), E_DeleteEmployeesExceedingCapacity(), and E_EmployeeDelete_f().

void E_DeleteEmployeesExceedingCapacity ( base_t base  ) 

Removes employee until all employees fit in quarters capacity.

Parameters:
[in] base Pointer to the base where the number of employees should be updated.
Note:
employees are killed, and not just unhired (if base is destroyed, you can't recruit the same employees elsewhere) if you want to unhire employees, you should do it before calling this function.
employees are not randomly chosen. Reason is that all Quarter will be destroyed at the same time, so all employees are going to be killed anyway.

Definition at line 889 of file cp_employee.c.

References CAP_EMPLOYEES, base_s::capacities, ccs, Com_Printf(), cap_maxcur_s::cur, E_DeleteEmployee(), E_IsInBase(), EMPL_ROBOT, ccs_s::employees, i, cap_maxcur_s::max, MAX_EMPL, base_s::name, ccs_s::numEmployees, and type.

Referenced by B_BuildingOnDestroy_f().

int E_GenerateHiredEmployeesList ( const base_t base  ) 

Fill employeeList with a list of employees in the current base (i.e. they are hired and not transferred).

Note:
Depends on cls.displayHeavyEquipmentList to be set correctly.
See also:
E_GetEmployeeByMenuIndex - It is used to get a specific entry from the generated employeeList.

Definition at line 231 of file cp_employee_callbacks.c.

References E_GetHiredEmployees(), EMPL_SOLDIER, and employeesInCurrentList.

Referenced by AIR_AssignInitial().

employee_t* E_GetAssignedEmployee ( const base_t *const   base,
const employeeType_t  type 
)

Gets an unassigned employee of a given type from the given base.

Parameters:
[in] base Which base the employee should be hired in.
[in] type The type of employee to search.
Returns:
employee_t
See also:
E_EmployeeIsUnassigned
Note:
assigned is not hired - they are already hired in a base, in a quarter _and_ working in another building.

Definition at line 454 of file cp_employee.c.

References E_EmployeeIsUnassigned(), and E_GetNextFromBase().

Referenced by RS_RemoveScientist().

employee_t* E_GetEmployee ( const base_t *const   base,
employeeType_t  type,
int  idx 
)

Return a given employee pointer in the given base of a given type. Also returns those employees, that are not yet hired.

Parameters:
[in] base Which base the employee should be hired in.
[in] type Which employee type do we search.
[in] idx Which employee id (in global employee array)
Returns:
employee_t pointer or NULL

Definition at line 292 of file cp_employee.c.

References E_GetNext(), E_IsHired, E_IsInBase(), employee_s::idx, and MAX_EMPL.

employee_t* E_GetEmployeeByMenuIndex ( int  num  ) 

Find an hired or free employee by the menu index.

Parameters:
[in] num The index from the hire menu screen (index inemployeeList).

Definition at line 243 of file cp_employee_callbacks.c.

References LIST_GetByIdx().

Referenced by AIM_AddEmployeeFromMenu(), CL_ActorPilotSelect_f(), CL_ActorTeamSelect_f(), CL_AssignPilot_f(), E_EmployeeDelete_f(), E_EmployeeHire_f(), E_EmployeeList_f(), and E_EmployeeSelect_f().

employee_t* E_GetEmployeeFromChrUCN ( int  uniqueCharacterNumber  ) 

Searches all employee for the ucn (character id).

Parameters:
[in] uniqueCharacterNumber unique character number (UCN)

Definition at line 1207 of file cp_employee.c.

References employee_s::chr, E_GetNext(), and character_s::ucn.

Referenced by AIR_LoadAircraftXML(), CP_ParseCharacterData(), E_ChangeName_f(), and TR_LoadXML().

const char* E_GetEmployeeString ( employeeType_t  type  ) 

Convert employeeType_t to translated string.

Parameters:
type employeeType_t value
Returns:
translated employee string

Definition at line 224 of file cp_employee.c.

References _, Com_Error(), EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, and ERR_DROP.

Referenced by B_CheckBuildingStatusForMenu_f(), BaseSummary_Init(), CL_StatsUpdate_f(), CP_NationHandleBudget(), HOS_UpdateMenu(), TR_CargoList(), and TR_TransferSelect().

employeeType_t E_GetEmployeeType ( const char *  type  ) 

Convert string to employeeType_t.

Parameters:
type Pointer to employee type string
Returns:
employeeType_t
Todo:
use Com_ConstInt*

Definition at line 248 of file cp_employee.c.

References EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, and MAX_EMPL.

Referenced by CL_ParseRanks().

employee_t* E_GetHiredEmployeeByUcn ( const base_t *const   base,
employeeType_t  type,
int  ucn 
)
int E_GetHiredEmployees ( const base_t *const   base,
employeeType_t  type,
linkedList_t **  hiredEmployees 
)

Return a list of hired employees in the given base of a given type.

Parameters:
[in] base Which base the employee should be searched in. If NULL is given employees in all bases will be listed.
[in] type Which employee type to search for.
[out] hiredEmployees Linked list of hired employees in the base.
Returns:
Number of hired employees in the base that are currently not on a transfer.

Definition at line 371 of file cp_employee.c.

References Com_Printf(), E_GetNextHired(), E_IsInBase(), LIST_AddPointer(), LIST_Count(), LIST_Delete(), MAX_EMPL, and employee_s::transfer.

Referenced by CL_UpdateEmployeeList(), CP_BaseAttackStartMission(), CP_GetWinProbabilty(), E_GenerateHiredEmployeesList(), and E_GetHiredRobot().

employee_t* E_GetHiredRobot ( const base_t *const   base,
const struct ugv_s ugvType 
)
employee_t* E_GetNext ( employeeType_t  type,
employee_t lastEmployee 
)

Iterates through employees.

Parameters:
[in] type Employee type to look for
[in] lastEmployee Pointer of the employee to iterate from. call with NULL to get the first one.
See also:
employeeType_t

Definition at line 43 of file cp_employee.c.

References ccs, ccs_s::employees, and ccs_s::numEmployees.

Referenced by E_CountUnhired(), E_CountUnhiredRobotsByType(), E_EmployeeList_f(), E_EmployeeListScroll_f(), E_GetEmployee(), E_GetEmployeeFromChrUCN(), E_GetNextFromBase(), E_GetNextHired(), E_GetUnhiredEmployee(), E_GetUnhiredRobot(), and E_SaveXML().

employee_t* E_GetNextFromBase ( employeeType_t  type,
employee_t lastEmployee,
const base_t base 
)

Iterates through employees on a base.

Parameters:
[in] type Employee type to look for
[in] lastEmployee Pointer of the employee to iterate from. call with NULL to get the first one.
[in] base Pointer to the base where employee hired at
See also:
employeeType_t

Definition at line 73 of file cp_employee.c.

References E_GetNext(), and E_IsInBase().

Referenced by CL_UpdateCharacterStats(), E_CountUnassigned(), E_GetAssignedEmployee(), E_GetUnassignedEmployee(), E_UnhireAllEmployees(), HOS_HealAll(), HOS_ListClick_f(), HOS_UpdateMenu(), TR_GetTransferEmployee(), TR_TransferListSelect_f(), and TR_TransferSelect().

employee_t* E_GetNextHired ( employeeType_t  type,
employee_t lastEmployee 
)

Iterates through hired employees.

Parameters:
[in] type Employee type to look for
[in] lastEmployee Pointer of the employee to iterate from. call with NULL to get the first one.
See also:
employeeType_t

Definition at line 91 of file cp_employee.c.

References E_GetNext(), and E_IsHired.

Referenced by CL_StatsUpdate_f(), CP_NationHandleBudget(), E_CountHired(), E_CountHiredRobotByType(), E_GetHiredEmployees(), and HOS_HospitalRun().

employee_t* E_GetUnassignedEmployee ( const base_t *const   base,
const employeeType_t  type 
)

Gets an assigned employee of a given type from the given base.

Parameters:
[in] base Which base the employee should be hired in.
[in] type The type of employee to search.
Returns:
employee_t
See also:
E_EmployeeIsUnassigned
Note:
unassigned is not unhired - they are already hired in a base but are at quarters

Definition at line 472 of file cp_employee.c.

References E_EmployeeIsUnassigned(), and E_GetNextFromBase().

Referenced by RS_AssignScientist(), RS_MaxOutResearch(), and RS_RemoveFiredScientist().

employee_t* E_GetUnhiredRobot ( const struct ugv_s ugvType  ) 
qboolean E_HireEmployee ( base_t base,
employee_t employee 
)

Hires the employee in a base.

Parameters:
[in] base Which base the employee should be hired in
[in] employee Which employee to hire
See also:
E_HireEmployeeByType
E_UnhireEmployee
Todo:
handle EMPL_ROBOT capacities here?

Definition at line 490 of file cp_employee.c.

References _, AIR_AutoAddPilotToAircraft(), employee_s::baseHired, CAP_EMPLOYEES, CAP_ITEMS, base_s::capacities, cap_maxcur_s::cur, EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, cap_maxcur_s::max, MAX_EMPL, PR_UpdateProductionCap(), qfalse, qtrue, employee_s::type, UGV_SIZE, and UI_Popup().

Referenced by E_EmployeeHire_f(), E_HireEmployeeByType(), E_HireRobot(), and TR_EmptyTransferCargo().

qboolean E_HireEmployeeByType ( base_t base,
employeeType_t  type 
)

Hires the first free employee of that type.

Parameters:
[in] base Which base the employee should be hired in
[in] type Which employee type do we search
See also:
E_HireEmployee
E_UnhireEmployee

Definition at line 530 of file cp_employee.c.

References E_GetUnhiredEmployee(), E_HireEmployee(), and qfalse.

Referenced by B_SetUpFirstBase(), and E_HireForBuilding().

void E_HireForBuilding ( base_t base,
building_t building,
int  num 
)

Hires some employees of appropriate type for a building.

Parameters:
[in] base Which base the employee should be hired in.
[in] building in which building
[in] num how many employees, if -1, hire building->maxEmployees
See also:
B_SetUpBase

Definition at line 144 of file cp_employee.c.

References B_HANGAR, B_LAB, B_MISC, B_WORKSHOP, building_s::buildingType, ccs, Com_DPrintf(), DEBUG_CLIENT, E_HireEmployeeByType(), EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, building_s::maxEmployees, and ccs_s::numEmployees.

Referenced by B_AddBuildingToBasePos().

qboolean E_HireRobot ( base_t base,
const struct ugv_s ugvType 
)
void E_Init ( void   ) 
void E_InitialEmployees ( void   ) 
void E_InitStartup ( void   ) 

This is more or less the initial Bind some of the functions in this file to console-commands that you can call ingame. Called from UI_InitStartup resp. CL_InitLocal.

Definition at line 1196 of file cp_employee.c.

References Cmd_AddCommand().

Referenced by CP_InitStartup().

qboolean E_IsAwayFromBase ( const employee_t employee  ) 

Tells you if a employee is away from his home base (gone in mission).

Parameters:
[in] employee Pointer to the employee.
Returns:
qboolean qtrue if the employee is away in mission, qfalse if he is not or he is unhired.

Definition at line 107 of file cp_employee.c.

References AIR_GetNextFromBase(), AIR_IsAircraftInBase(), AIR_IsInAircraftTeam(), employee_s::baseHired, E_IsHired, EMPL_PILOT, EMPL_ROBOT, EMPL_SOLDIER, qfalse, qtrue, employee_s::transfer, and employee_s::type.

Referenced by CP_BaseAttackStartMission(), CP_GetWinProbabilty(), HOS_ListClick_f(), and HOS_UpdateMenu().

qboolean E_IsInBase ( const employee_t empl,
const base_t *const   base 
)
qboolean E_MoveIntoNewBase ( employee_t employee,
base_t newBase 
)

Will change the base where the employee is located in and will also update the capacity in the affected bases.

Note:
Doesn't make any capacity checks and the employee must be hired already.
Parameters:
employee The employee to change the base for
newBase The base where the employee should be located at
Returns:
false if employee was a NULL pointer

Definition at line 205 of file cp_employee.c.

References employee_s::baseHired, CAP_EMPLOYEES, base_s::capacities, cap_maxcur_s::cur, qfalse, and qtrue.

Referenced by AIR_MoveAircraftIntoNewHomebase().

void E_RefreshUnhiredEmployeeGlobalList ( const employeeType_t  type,
const qboolean  excludeUnhappyNations 
)

Recreates all the employees for a particular employee type in the global list. But it does not overwrite any employees already hired.

Parameters:
[in] type The type of the employee list to process.
[in] excludeUnhappyNations True if a nation is unhappy then they wont send any pilots, false if happiness of nations in not considered.
See also:
CP_NationHandleBudget

Definition at line 930 of file cp_employee.c.

References ccs, E_CreateEmployeeAtIndex(), E_IsHired, ccs_s::employees, nationInfo_s::happiness, MAX_EMPLOYEES, MAX_NATIONS, ccs_s::nations, ccs_s::numNations, and nation_s::stats.

Referenced by CP_NationHandleBudget().

qboolean E_RemoveEmployeeFromBuildingOrAircraft ( employee_t employee  ) 

Remove one employee from building.

Todo:
Add check for base vs. employee_type and abort if they do not match.
Parameters:
[in] employee What employee to remove from its building.
Returns:
Returns true if removing was possible/sane otherwise false.
See also:
E_AssignEmployeeToBuilding
Todo:
are soldiers and pilots assigned to a building, too? quarters?

Definition at line 972 of file cp_employee.c.

References AIR_IsEmployeeInAircraft(), AIR_RemoveEmployee(), AIR_RemovePilotFromAssignedAircraft(), employee_s::baseHired, employee_s::building, Com_Error(), EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, ERR_DROP, MAX_EMPL, PR_UpdateProductionCap(), qfalse, qtrue, RS_RemoveFiredScientist(), and employee_s::type.

Referenced by E_ResetEmployee().

void E_RemoveInventoryFromStorage ( employee_t employee  ) 

Removes the items of an employee (soldier) from the base storage (s)he is hired at.

Parameters:
[in] employee Pointer to the soldier whose items should be removed

Definition at line 1362 of file cp_employee.c.

References B_UpdateStorageAndCapacity(), employee_s::baseHired, employee_s::chr, CONTAINER, csi, INVDEF, invList_s::item, item_s::m, invList_s::next, csi_s::numIDs, qfalse, and item_s::t.

Referenced by AIR_DestroyAircraft().

void E_ResetEmployee ( employee_t employee  ) 

Removes the inventory of the employee and also removes him from buildings.

Note:
This is used in the transfer start function (when you transfer an employee this must be called for him to make him no longer useable in the current base) and is also used when you completely unhire an employee.
See also:
E_UnhireEmployee

Definition at line 555 of file cp_employee.c.

References employee_s::chr, cls, inventoryInterface_s::DestroyInventory, E_IsHired, E_RemoveEmployeeFromBuildingOrAircraft(), character_s::i, and client_static_s::i.

Referenced by E_UnhireEmployee(), and TR_TransferStart().

void E_ResetEmployees ( void   ) 

Clears the employees list for loaded and new games.

See also:
CL_ResetSinglePlayerData
E_DeleteEmployee

Definition at line 272 of file cp_employee.c.

References ccs, Com_DPrintf(), DEBUG_CLIENT, EMPL_SOLDIER, ccs_s::employees, i, MAX_EMPL, and ccs_s::numEmployees.

Referenced by CL_ResetSinglePlayerData().

void E_UnhireAllEmployees ( base_t base,
employeeType_t  type 
)

Reset the hired flag for all employees of a given type in a given base.

Parameters:
[in] base Which base the employee should be fired from.
[in] type Which employee type do we search.

Definition at line 614 of file cp_employee.c.

References E_GetNextFromBase(), E_UnhireEmployee(), and MAX_EMPL.

qboolean E_UnhireEmployee ( employee_t employee  ) 

Generated by  doxygen 1.6.2