• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ [TFFS 1.3 - Source] Error C2280 'spellBlock_t &spellBlock_t::operator =(const spellBlock_t &)'

Yan18

Member
Joined
Jun 14, 2014
Messages
104
Solutions
3
Reaction score
17
Hi folks!

I need help with a error in the source, it is being headache 😂. I tried to figured out the problem at the internet, but I didn't understand the issue yet.

The issue is:

C++:
Console Error List: Error C2280 'spellBlock_t &spellBlock_t::operator =(const spellBlock_t &)': attempting to reference a deleted function (compiling origin file ..\src\monster.cpp) theforgottenserver F:\Programs Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xutility 4198  
   
Console Output: src\monsters.h(75,16): message : 'spellBlock_t &spellBlock_t::operator =(const spellBlock_t &)': the function was explicitly deleted (compiling origin file ..\src\monster.cpp)
1>F:\Programs File\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(1175): message : confer the reference to instantiation '_OutIt *std::_Copy_unchecked<_Iter,spellBlock_t*>(_InIt,_InIt,_OutIt)' of the model that has been compiling.

In the monster class, I added a variable to receive xml monster attacks in std::vector<spellBlock_t> from mType->info.attackSpells and after that, I can't compile the source more.
 
Show what you modified, cause from the error looks like you are copying and spellblock does not allow that, probably because there is a pointer inside
 
Show what you modified, cause from the error looks like you are copying and spellblock does not allow that, probably because there is a pointer inside
I want to remove all attacks (except Melee) from Summons. In monster.cpp class at function Monster::Monster(MonsterType* mType) : Creature(), strDescription(mType->nameDescription), mType(mType) I made:

C++:
if (this->isSummon())
{
    for (auto iterator = this->mType->info.attackSpells.begin(), end = this->mType->info.attackSpells.end(); iterator != end; iterator++)
    {
        if (iterator->spell != g_spells.getSpellByName("Melee"))
        {
            this->mType->info.attackSpells.erase(iterator);
        }         
    }     
}

I noticed that this error occurs always only when I use the method erase from std::vector<spellBlock_t>
 
Last edited:
Back
Top