From 3125e8eca7d30eea57c930d6d6a33bbd9f9f72c1 Mon Sep 17 00:00:00 2001 From: dnsobchuk Date: Tue, 3 Feb 2026 21:35:04 +0300 Subject: [PATCH] Fix: correct array allocation syntax in multiple places - zCArraySort constructor: new T[startSize] - ShrinkToFit method: new T[numInArray] - Both were using incorrect new T()[size] syntax --- UnionProject/GothicAPI/Gothic_II_Addon/API/zContainer.h | 4 ++-- UnionProject/GothicAPI/Gothic_II_Classic/API/zContainer.h | 4 ++-- UnionProject/GothicAPI/Gothic_I_Addon/API/zContainer.h | 4 ++-- UnionProject/GothicAPI/Gothic_I_Classic/API/zContainer.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/UnionProject/GothicAPI/Gothic_II_Addon/API/zContainer.h b/UnionProject/GothicAPI/Gothic_II_Addon/API/zContainer.h index 00db409..613b5c0 100644 --- a/UnionProject/GothicAPI/Gothic_II_Addon/API/zContainer.h +++ b/UnionProject/GothicAPI/Gothic_II_Addon/API/zContainer.h @@ -285,7 +285,7 @@ namespace Gothic_II_Addon { numAlloc = startSize; array = 0; if( startSize > 0 ) - array = new T()[startSize]; + array = new T[startSize]); SetCompare( zArraySortDefaultCompare ); } @@ -337,7 +337,7 @@ namespace Gothic_II_Addon { return; } if( numAlloc > numInArray ) { - T* newArray = new T()[numInArray]; + T* newArray = new T[numInArray]; for( int i = 0; i < numInArray; i++ ) newArray[i] = array[i]; delete[] array; diff --git a/UnionProject/GothicAPI/Gothic_II_Classic/API/zContainer.h b/UnionProject/GothicAPI/Gothic_II_Classic/API/zContainer.h index bb9e603..0279e12 100644 --- a/UnionProject/GothicAPI/Gothic_II_Classic/API/zContainer.h +++ b/UnionProject/GothicAPI/Gothic_II_Classic/API/zContainer.h @@ -285,7 +285,7 @@ namespace Gothic_II_Classic { numAlloc = startSize; array = 0; if( startSize > 0 ) - array = new T()[startSize]; + array = new T[startSize]; SetCompare( zArraySortDefaultCompare ); } @@ -337,7 +337,7 @@ namespace Gothic_II_Classic { return; } if( numAlloc > numInArray ) { - T* newArray = new T()[numInArray]; + T* newArray = new T[numInArray]; for( int i = 0; i < numInArray; i++ ) newArray[i] = array[i]; delete[] array; diff --git a/UnionProject/GothicAPI/Gothic_I_Addon/API/zContainer.h b/UnionProject/GothicAPI/Gothic_I_Addon/API/zContainer.h index dde494f..0e26e84 100644 --- a/UnionProject/GothicAPI/Gothic_I_Addon/API/zContainer.h +++ b/UnionProject/GothicAPI/Gothic_I_Addon/API/zContainer.h @@ -286,7 +286,7 @@ namespace Gothic_I_Addon { numAlloc = startSize; array = 0; if( startSize > 0 ) - array = new T()[startSize]; + array = new T[startSize]; SetCompare( zArraySortDefaultCompare ); } @@ -338,7 +338,7 @@ namespace Gothic_I_Addon { return; } if( numAlloc > numInArray ) { - T* newArray = new T()[numInArray]; + T* newArray = new T[numInArray]; for( int i = 0; i < numInArray; i++ ) newArray[i] = array[i]; delete[] array; diff --git a/UnionProject/GothicAPI/Gothic_I_Classic/API/zContainer.h b/UnionProject/GothicAPI/Gothic_I_Classic/API/zContainer.h index 44d3bf8..0c6aa94 100644 --- a/UnionProject/GothicAPI/Gothic_I_Classic/API/zContainer.h +++ b/UnionProject/GothicAPI/Gothic_I_Classic/API/zContainer.h @@ -286,7 +286,7 @@ namespace Gothic_I_Classic { numAlloc = startSize; array = 0; if( startSize > 0 ) - array = new T()[startSize]; + array = new T[startSize]; SetCompare( zArraySortDefaultCompare ); } @@ -338,7 +338,7 @@ namespace Gothic_I_Classic { return; } if( numAlloc > numInArray ) { - T* newArray = new T()[numInArray]; + T* newArray = new T[numInArray]; for( int i = 0; i < numInArray; i++ ) newArray[i] = array[i]; delete[] array;