Merge branch 'save_ext' into jgrpp
# Conflicts: # Makefile.src.in # findversion.sh # projects/determineversion.vbs # src/lang/dutch.txt # src/lang/korean.txt # src/network/network.cpp # src/network/network_client.cpp # src/rail.cpp # src/rail_cmd.cpp # src/saveload/afterload.cpp # src/ship_cmd.cpp # src/toolbar_gui.cpp # src/vehicle.cpp
This commit is contained in:
@@ -152,18 +152,20 @@ DEFINE_POOL_METHOD(void *)::GetNew(size_t size)
|
||||
* @param size size of item
|
||||
* @param index index of item
|
||||
* @return pointer to allocated item
|
||||
* @note usererror() on failure! (index out of range or already used)
|
||||
* @note SlErrorCorruptFmt() on failure! (index out of range or already used)
|
||||
*/
|
||||
DEFINE_POOL_METHOD(void *)::GetNew(size_t size, size_t index)
|
||||
{
|
||||
extern void NORETURN SlErrorCorruptFmt(const char *format, ...);
|
||||
|
||||
if (index >= Tmax_size) {
|
||||
usererror("failed loading savegame: %s index " PRINTF_SIZE " out of range (" PRINTF_SIZE ")", this->name, index, Tmax_size);
|
||||
SlErrorCorruptFmt("%s index " PRINTF_SIZE " out of range (" PRINTF_SIZE ")", this->name, index, Tmax_size);
|
||||
}
|
||||
|
||||
if (index >= this->size) this->ResizeFor(index);
|
||||
|
||||
if (this->data[index] != NULL) {
|
||||
usererror("failed loading savegame: %s index " PRINTF_SIZE " already in use", this->name, index);
|
||||
SlErrorCorruptFmt("%s index " PRINTF_SIZE " already in use", this->name, index);
|
||||
}
|
||||
|
||||
return this->AllocateItem(size, index);
|
||||
|
Reference in New Issue
Block a user