OpenTTD Source 20260129-master-g2bb01bd0e4
newgrf_act0_cargo.cpp File Reference

NewGRF Action 0x00 handler for cargo. More...

#include "../stdafx.h"
#include "../debug.h"
#include "../newgrf_cargo.h"
#include "newgrf_bytereader.h"
#include "newgrf_internal.h"
#include "newgrf_stringmapping.h"
#include "../safeguards.h"

Go to the source code of this file.

Functions

static void MaybeInstallFallbackCargoLabel (uint id, uint last, CargoLabel label)
 Install cargo label in a fallback cargo list, if a NewGRF-defined cargo list is not present.
 
static ChangeInfoResult CargoReserveInfo (uint first, uint last, int prop, ByteReader &buf)
 Define properties for cargoes.
 

Detailed Description

NewGRF Action 0x00 handler for cargo.

Definition in file newgrf_act0_cargo.cpp.

Function Documentation

◆ CargoReserveInfo()

◆ MaybeInstallFallbackCargoLabel()

static void MaybeInstallFallbackCargoLabel ( uint  id,
uint  last,
CargoLabel  label 
)
static

Install cargo label in a fallback cargo list, if a NewGRF-defined cargo list is not present.

This allows this NewGRF to use its self-defined cargo types without needing an explicit translation table.

Parameters
idID of the cargo.
lastID of the last cargo being set up.
labelLabel to install.

Definition at line 26 of file newgrf_act0_cargo.cpp.

References GRFFile::cargo_list, GRFFile::cargo_list_is_fallback, CT_INVALID, GetCargoTranslationTable(), and GrfProcessingState::grffile.

Referenced by CargoReserveInfo().