overlaytopleft/games-fps/gzdoom/files/0006-Fix-wrong-assumptions-about-actor-initialization-in-.patch

56 lines
1.7 KiB
Diff

From 50c0860dd6dd34c9aeff63e8cc348ecdc103f498 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= <ricolvs123@gmail.com>
Date: Mon, 5 Dec 2022 15:05:08 -0300
Subject: [PATCH 06/51] Fix wrong assumptions about actor initialization in
Map/MapIterator
---
src/common/scripting/core/types.cpp | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/src/common/scripting/core/types.cpp b/src/common/scripting/core/types.cpp
index 3054335ac..838275dad 100644
--- a/src/common/scripting/core/types.cpp
+++ b/src/common/scripting/core/types.cpp
@@ -2399,10 +2399,6 @@ void PMap::Construct(void * addr) const {
void PMap::InitializeValue(void *addr, const void *def) const
{
- if (def != nullptr)
- {
- I_Error("Map cannot have default values");
- }
Construct(addr);
}
@@ -2475,7 +2471,6 @@ void PMap::DestroyValue(void *addr) const
void PMap::SetDefaultValue(void *base, unsigned offset, TArray<FTypeAndOffset> *special)
{
- assert(!(base && special));
if (base != nullptr)
{
Construct(((uint8_t*)base)+offset); // is this needed? string/dynarray do this initialization if base != nullptr, but their initialization doesn't need to allocate
@@ -2868,10 +2863,6 @@ void PMapIterator::Construct(void * addr) const {
void PMapIterator::InitializeValue(void *addr, const void *def) const
{
- if (def != nullptr)
- {
- I_Error("Map cannot have default values");
- }
Construct(addr);
}
@@ -2944,7 +2935,6 @@ void PMapIterator::DestroyValue(void *addr) const
void PMapIterator::SetDefaultValue(void *base, unsigned offset, TArray<FTypeAndOffset> *special)
{
- assert(!(base && special));
if (base != nullptr)
{
Construct(((uint8_t*)base)+offset);
--
2.39.3