• 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!

Compiling CriticalHitChance

marcos16

Falkhonn
Joined
May 4, 2012
Messages
224
Reaction score
1
I am adding criticalhitchance attribute in TFS 0.3.7 Damson Crying. When it arrives in player.cpp it gives the following error:

Code:
player.cpp: In member function âvirtual int32_t Player::getCriticalHitChance() constâ:
player.cpp:453:39: error: âiâ was not declared in this scope
  CXX    position.o
make[1]: *** [player.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/ot/sources'

Error Line:

Code:
int32_t Player::getCriticalHitChance() const
int32_t Player::getCriticalHitChance() const
{
    Item* item = NULL;
    int32_t crit = 0;
    for(uint32_t slot = SLOT_RIGHT; slot <= SLOT_LEFT; ++slot)
    {
HERE>     if(item = getInventoryItem((slots_t)slot))
            crit += item->getCriticalHitChance();
    }

    return crit;
}

Help. REP+
 
I am adding criticalhitchance attribute in TFS 0.3.7 Damson Crying. When it arrives in player.cpp it gives the following error:

Code:
player.cpp: In member function âvirtual int32_t Player::getCriticalHitChance() constâ:
player.cpp:453:39: error: âiâ was not declared in this scope
  CXX    position.o
make[1]: *** [player.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/ot/sources'

Error Line:

Code:
int32_t Player::getCriticalHitChance() const
int32_t Player::getCriticalHitChance() const
{
    Item* item = NULL;
    int32_t crit = 0;
    for(uint32_t slot = SLOT_RIGHT; slot <= SLOT_LEFT; ++slot)
    {
HERE>     if(item = getInventoryItem((slots_t)slot))
            crit += item->getCriticalHitChance();
    }

    return crit;
}

Help. REP+

What is on line 453? Is it Item::getCriticalHitChance()?
Try to clean the solution and rebuild, that normally fix strange things like that.
 
Back
Top