41 for (
int i = 0;
i <
csi.numEDs;
i++) {
74 UI_Popup(
_(
"Warning"),
_(
"This soldier can not carry anything else."));
79 const int moved =
cls.i.moveInInventory(inv, fromContainer, fItem, toContainer, toX, toY,
nullptr, uponItem);
105 x += weaponList->
getX();
106 y += weaponList->
getY();
122 return INV_MoveItem(inv, destContainer, x, y, srcContainer, ic,
nullptr);
139 if (container && inv) {
143 moved =
cls.i.addToInventory(inv, &item, container,
NONE,
NONE, 1) !=
nullptr;
145 if (moved || weapon->
def() == weapon->
ammoDef()) {
159static void INV_InventoryList_f (
void)
161 for (
int i = 0;
i <
csi.numODs;
i++) {
172 Com_Printf(
"... usable for weapon (if type is ammo):\n");
191 for (
int i = 0;
i <
csi.numEDs;
i++) {
199 for (
int j = 0; j <
csi.numODs; j++) {
206 Com_Printf(
"INV_EquipmentDefSanityCheck: Equipment Def '%s' has a total probability for primary weapons greater than 100\n", ed->
id);
212 for (
int j = 0; j <
csi.numODs; j++) {
218 Com_Printf(
"INV_EquipmentDefSanityCheck: Equipment Def '%s' has a total probability for secondary weapons greater than 100\n", ed->
id);
224 for (
int j = 0; j <
csi.numODs; j++) {
230 Com_Printf(
"INV_EquipmentDefSanityCheck: Equipment Def '%s' has a total probability for armours greater than 100\n", ed->
id);
259 Sys_Error(
"INV_GetFilterFromItem: unknown filter category for item '%s'", obj->
id);
273 switch (filterType) {
339 Com_Printf(
"INV_ItemMatchesFilter: Unknown filter type for items: %i\n", filterType);
359 if (itemType ==
nullptr)
366 if (itemType == ic->def())
403 if (filterTypeID[0] ==
'\0')
408 if (fileTypeName &&
Q_streq(fileTypeName, filterTypeID))
428 Cmd_AddCommand(
"debug_listinventory", INV_InventoryList_f,
"Print the current inventory to the game console");
character_t * GAME_GetSelectedChr(void)
Returns the currently selected character.
int GAME_GetChrMaxLoad(const character_t *chr)
Returns the max weight the given character can carry.
Shared game type headers.
bool INV_MoveItem(Inventory *inv, const invDef_t *toContainer, int toX, int toY, const invDef_t *fromContainer, Item *fItem, Item **uponItem)
Move item between containers.
itemFilterTypes_t INV_GetFilterFromItem(const objDef_t *obj)
static bool INV_EquipmentDefSanityCheck(void)
Make sure equipment definitions used to generate teams are proper.
void INV_InitStartup(void)
itemFilterTypes_t INV_GetFilterTypeID(const char *filterTypeID)
Searches for a filter type name (as used in console functions) and returns the matching itemFilterTyp...
const equipDef_t * INV_GetEquipmentDefinitionByID(const char *name)
Gets equipment definition by id.
bool INV_UnloadWeapon(Item *weapon, Inventory *inv, const invDef_t *container)
Unload a weapon and put the ammo in a container.
bool INV_LoadWeapon(const Item *weaponList, Inventory *inv, const invDef_t *srcContainer, const invDef_t *destContainer)
Load a weapon with ammo.
const char * INV_GetFilterType(itemFilterTypes_t id)
static char const *const filterTypeNames[]
Item * INV_SearchInInventoryWithFilter(const Inventory *const inv, const invDef_t *container, const objDef_t *itemType, const itemFilterTypes_t filterType)
Searches if there is an item at location (x/y) in a scrollable container. You can also provide an ite...
bool INV_ItemMatchesFilter(const objDef_t *obj, const itemFilterTypes_t filterType)
Checks if the given object/item matched the given filter type.
Header file for inventory handling and Equipment menu.
itemFilterTypes_t
A list of filter types in the market and production view.
@ MAX_SOLDIER_FILTERTYPES
void INV_InitCallbacks(void)
inventory definition with all its containers
bool canHoldItemWeight(containerIndex_t from, containerIndex_t to, const Item &item, int maxWeight) const
Check that adding an item to the inventory won't exceed the max permitted weight.
Item * getItemAtPos(const invDef_t *container, const int x, const int y) const
Searches if there is an item at location (x,y) in a container.
Item * getContainer2(const containerIndex_t idx) const
item instance data, with linked list capability
const objDef_t * ammoDef(void) const
void setAmmoDef(const objDef_t *od)
const objDef_t * def(void) const
void getFirstShapePosition(int *const x, int *const y) const
Calculates the first "true" bit in the shape and returns its position in the item.
void setAmmoLeft(int value)
Primary header for client.
void Cmd_AddCommand(const char *cmdName, xcommand_t function, const char *desc)
Add a new command to the script interface.
void Com_Error(int code, const char *fmt,...)
void Com_Printf(const char *const fmt,...)
void Sys_Error(const char *error,...)
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
#define SHAPE_BIG_MAX_WIDTH
32 bit mask
#define SHAPE_BIG_MAX_HEIGHT
defines the max height of an inventory container
Shared parsing functions.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
char const * Q_strstart(char const *str, char const *start)
Matches the start of a string.
int numItems[MAX_OBJDEFS]
inventory definition for our menus
Defines all attributes of objects used in the inventory.
const struct objDef_s * ammos[MAX_AMMOS_PER_OBJDEF]
bool isReloadable() const
const struct objDef_s * weapons[MAX_WEAPONS_PER_OBJDEF]
bool isCraftItem() const
Checks whether a given item is an aircraftitem item.