Explorar o código

Merge pull request #40913 from godotengine/localv

Fixes issue with LocalVector remove function
Rémi Verschelde %!s(int64=5) %!d(string=hai) anos
pai
achega
4fb0ae3e9f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      core/local_vector.h

+ 1 - 1
core/local_vector.h

@@ -73,10 +73,10 @@ public:
 
 	void remove(U p_index) {
 		ERR_FAIL_UNSIGNED_INDEX(p_index, count);
+		count--;
 		for (U i = p_index; i < count; i++) {
 			data[i] = data[i + 1];
 		}
-		count--;
 		if (!__has_trivial_destructor(T) && !force_trivial) {
 			data[count].~T();
 		}