Fix wrong assumptions about actor initialization in Map/MapIterator

This commit is contained in:
Ricardo Luís Vaz Silva 2022-12-05 15:05:08 -03:00 committed by Christoph Oelckers
parent 911d27148b
commit b610f4206f

View file

@ -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);