Index: src/ai/api/ai_cargo.hpp =================================================================== --- src/ai/api/ai_cargo.hpp (revision 12187) +++ src/ai/api/ai_cargo.hpp (working copy) @@ -30,14 +30,14 @@ * @return the cargo label. * @note the returned cargo label must be free'd (C++ only). */ - char *GetCargoLabel(CargoID cargo_type); + static char *GetCargoLabel(CargoID cargo_type); /** * Checks whether the give cargo is a freight or not. * @param cargo_type is this cargo freight or not? * @return true if and only if the cargo is freight. */ - bool IsFreight(CargoID cargo_type); + static bool IsFreight(CargoID cargo_type); /** * Get the income for transporting a piece of cargo over the @@ -47,7 +47,7 @@ * @param cargo_type the cargo to transport. * @return the amount of money that would be earned by this trip. */ - int32 GetCargoIncome(uint32 distance, uint32 days_in_transit, CargoID cargo_type); + static int32 GetCargoIncome(uint32 distance, uint32 days_in_transit, CargoID cargo_type); }; #endif /* AI_CARGO_HPP */ Index: src/ai/api/ai_cargo.hpp.sq =================================================================== --- src/ai/api/ai_cargo.hpp.sq (revision 12187) +++ src/ai/api/ai_cargo.hpp.sq (working copy) @@ -14,12 +14,11 @@ SQAICargo.PreRegister(engine); SQAICargo.AddConstructor(engine, "x"); - SQAICargo.DefSQStaticMethod(engine, &AICargo::GetClassName, "GetClassName", 1, "x"); - SQAICargo.DefSQStaticMethod(engine, &AICargo::IsValidCargo, "IsValidCargo", 2, "xi"); + SQAICargo.DefSQStaticMethod(engine, &AICargo::GetClassName, "GetClassName", 1, "x"); + SQAICargo.DefSQStaticMethod(engine, &AICargo::IsValidCargo, "IsValidCargo", 2, "xi"); + SQAICargo.DefSQStaticMethod(engine, &AICargo::GetCargoLabel, "GetCargoLabel", 2, "xi"); + SQAICargo.DefSQStaticMethod(engine, &AICargo::IsFreight, "IsFreight", 2, "xi"); + SQAICargo.DefSQStaticMethod(engine, &AICargo::GetCargoIncome, "GetCargoIncome", 4, "xiii"); - SQAICargo.DefSQMethod(engine, &AICargo::GetCargoLabel, "GetCargoLabel", 2, "xi"); - SQAICargo.DefSQMethod(engine, &AICargo::IsFreight, "IsFreight", 2, "xi"); - SQAICargo.DefSQMethod(engine, &AICargo::GetCargoIncome, "GetCargoIncome", 4, "xiii"); - SQAICargo.PostRegister(engine); } Index: src/ai/api/ai_cargo.cpp =================================================================== --- src/ai/api/ai_cargo.cpp (revision 12187) +++ src/ai/api/ai_cargo.cpp (working copy) @@ -13,9 +13,9 @@ return (cargo_type < NUM_CARGO && GetCargo(cargo_type)->IsValid()); } -char *AICargo::GetCargoLabel(CargoID cargo_type) +/* static */ char *AICargo::GetCargoLabel(CargoID cargo_type) { - if (!this->IsValidCargo(cargo_type)) return NULL; + if (!IsValidCargo(cargo_type)) return NULL; const CargoSpec *cargo = GetCargo(cargo_type); /* cargo->label is a uint32 packing a 4 character non-terminated string, @@ -28,15 +28,15 @@ return cargo_label; } -bool AICargo::IsFreight(CargoID cargo_type) +/* static */ bool AICargo::IsFreight(CargoID cargo_type) { - if (!this->IsValidCargo(cargo_type)) return false; + if (!IsValidCargo(cargo_type)) return false; const CargoSpec *cargo = GetCargo(cargo_type); return cargo->is_freight; } -int32 AICargo::GetCargoIncome(uint32 distance, uint32 days_in_transit, CargoID cargo_type) +/* static */ int32 AICargo::GetCargoIncome(uint32 distance, uint32 days_in_transit, CargoID cargo_type) { - if (!this->IsValidCargo(cargo_type)) return 0; + if (!IsValidCargo(cargo_type)) return 0; return GetTransportedGoodsIncome(1, distance, days_in_transit, cargo_type); }