• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Compiled Problem

Exactly

New Member
Joined
Jul 14, 2014
Messages
119
Reaction score
4
player.cpp: In member function 'virtual void Player::postAddNotification(Creature*, Thing*, const Cylinder*, int32_t, CylinderLink_t)':
player.cpp:3442:7: warning: variable 'requireListUpdate' set but not used [-Wunused-but-set-variable]
player.cpp: In member function 'virtual void Player::postRemoveNotification(Creature*, Thing*, const Cylinder*, int32_t, bool, CylinderLink_t)':
player.cpp:3487:7: warning: variable 'requireListUpdate' set but not used [-Wunused-but-set-variable]

Line 3442

Code:
bool requireListUpdate = true;
    if(link == LINK_OWNER || link == LINK_TOPPARENT)
    {
        if(const Item* item = (oldParent ? oldParent->getItem() : NULL))
        {
            assert(item->getContainer() != NULL);
            requireListUpdate = item->getContainer()->getHoldingPlayer() != this;
        }
        else
            requireListUpdate = oldParent != this;

        updateInventoryWeight();
        updateItemsLight();
        updateWeapon();
        sendStats();
    }

Line 3487

Code:
bool requireListUpdate = true;
    if(link == LINK_OWNER || link == LINK_TOPPARENT)
    {
        if(const Item* item = (newParent ? newParent->getItem() : NULL))
        {
            assert(item->getContainer() != NULL);
            requireListUpdate = item->getContainer()->getHoldingPlayer() == this;
        }
        else
            requireListUpdate = newParent == this;

        updateInventoryWeight();
        updateItemsLight();
        updateWeapon();
        sendStats();
    }

Thanks!
 
it tells you what the error is in plain english
warning: variable 'requireListUpdate' set but not used
its telling you that requireListUpdate was initialized but wasn't used anywhere, so you have a pointless variable
 
Work Thanks,

But have one more error:

otserv.cpp: In function 'void otserv(StringVec, ServiceManager*)':
otserv.cpp:674:42: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
otserv.cpp:684:58: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
otserv.cpp:702:63: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
otserv.cpp:720:56: warning: suggest parentheses around assignment used as truth value [-Wparentheses]

Script:

http://pastebin.com/aDeyB7XC
 
Work Thanks,

But have one more error:



Script:

http://pastebin.com/aDeyB7XC
you need to add another set of parentheses () around the condition in the if statement
the compiler wants you to be more clear with the assignment
if (result = db->storeQuery(query.str())) -> if ((result = db->storeQuery(query.str())))
^ just an example with line 674
do the same with the other errors
 
Don't work

otserv.cpp: In function 'void otserv(StringVec, ServiceManager*)':
otserv.cpp:674:42: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
otserv.cpp:674:44: error: expected primary-expression before '->' token
otserv.cpp:674:47: error: expected unqualified-id before 'if'
otserv.cpp:674:47: error: expected ';' before 'if'
otserv.cpp:672:7: warning: unused variable 'duplicated' [-Wunused-variable]
otserv.cpp:1031:1: error: expected '}' at end of input

Maybe can u change this for me?
 

Similar threads

Back
Top