~ubuntu-branches/ubuntu/trusty/manaplus/trusty

« back to all changes in this revision

Viewing changes to src/being/localplayer.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-10-07 10:26:14 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20131007102614-tg2zjdz8vmtl6n7i
Tags: 1.3.9.29-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
357
357
 
358
358
    if (mTestParticleTime != time && !mTestParticleName.empty())
359
359
    {
360
 
        unsigned long hash = UpdaterWindow::getFileHash(mTestParticleName);
 
360
        const unsigned long hash = UpdaterWindow::getFileHash(
 
361
            mTestParticleName);
361
362
        if (hash != mTestParticleHash)
362
363
        {
363
364
            setTestParticle(mTestParticleName, false);
803
804
    if (Net::getNetworkType() != ServerInfo::MANASERV)
804
805
#endif
805
806
    {
806
 
        Party *const party = Party::getParty(1);
 
807
        const Party *const party = Party::getParty(1);
807
808
        if (party)
808
809
        {
809
810
            PartyMember *const pm = party->getMember(getName());
989
990
            Net::getPlayerHandler()->setDestination(x, y, mDirection);
990
991
            Being::setDestination(x, y);
991
992
        }
992
 
        else if (mInvertDirection == 1)
 
993
        else
993
994
        {
994
995
            uint8_t newDir = 0;
995
996
            if (mDirection & UP)
1010
1011
            }
1011
1012
 
1012
1013
            Being::setDestination(x, y);
1013
 
        }
1014
 
        else
1015
 
        {
 
1014
 
1016
1015
#ifdef MANASERV_SUPPORT
1017
1016
            // Manaserv:
1018
1017
            // If the destination given to being class is accepted,
1243
1242
    if (!target || target->getType() == ActorSprite::NPC)
1244
1243
        return;
1245
1244
 
1246
 
    if (mTarget != target || !mTarget)
 
1245
    if (mTarget != target)
1247
1246
        setTarget(target);
1248
1247
 
1249
1248
#ifdef MANASERV_SUPPORT
1596
1595
        mTargetOnlyReachable = config.getBoolValue("targetOnlyReachable");
1597
1596
}
1598
1597
 
1599
 
void LocalPlayer::processEvent(Channels channel,
 
1598
void LocalPlayer::processEvent(const Channels channel,
1600
1599
                               const DepricatedEvent &event)
1601
1600
{
1602
1601
    if (channel == CHANNEL_ATTRIBUTES)
1977
1976
        &LocalPlayer::getAttackWeaponTypeString, 1);
1978
1977
}
1979
1978
 
1980
 
static const char *attackWeaponTypeStrings[] =
 
1979
static const char *const attackWeaponTypeStrings[] =
1981
1980
{
1982
1981
    // TRANSLATORS: switch attack type in status bar
1983
1982
    N_("(?) attack"),
2237
2236
    }
2238
2237
}
2239
2238
 
2240
 
static const char *awayModeStrings[] =
 
2239
static const char *const awayModeStrings[] =
2241
2240
{
2242
2241
    // TRANSLATORS: away type in status bar
2243
2242
    N_("(O) on keyboard"),
2255
2254
 
2256
2255
const unsigned cameraModeSize = 2;
2257
2256
 
2258
 
static const char *cameraModeStrings[] =
 
2257
static const char *const cameraModeStrings[] =
2259
2258
{
2260
2259
    // TRANSLATORS: camera mode in status bar
2261
2260
    N_("(G) game camera mode"),
3348
3347
        }
3349
3348
        else
3350
3349
        {
3351
 
            if (specialLayer && iter != mHomes.end())
 
3350
            if (iter != mHomes.end())
3352
3351
            {
3353
3352
                specialLayer->setTile(static_cast<int>(pos.x),
3354
3353
                    static_cast<int>(pos.y), MapItem::EMPTY);
3527
3526
        if (mAfkTime == 0 || time < mAfkTime
3528
3527
            || time - mAfkTime > awayLimitTimer)
3529
3528
        {
3530
 
            const std::string msg = "*AFK*: "
3531
 
                + config.getStringValue("afkMessage");
 
3529
            const std::string msg("*AFK*: "
 
3530
                + config.getStringValue("afkMessage"));
3532
3531
 
3533
3532
            if (!tab)
3534
3533
            {
3816
3815
                return;
3817
3816
        }
3818
3817
        setTarget(target);
3819
 
        if (target && target->getType() != Being::NPC)
 
3818
        if (target->getType() != Being::NPC)
3820
3819
        {
3821
3820
            mKeepAttacking = true;
3822
3821
            moveToTarget();
4313
4312
    }
4314
4313
}
4315
4314
 
4316
 
void LocalPlayer::setTestParticle(const std::string &fileName, bool updateHash)
 
4315
void LocalPlayer::setTestParticle(const std::string &fileName,
 
4316
                                  const bool updateHash)
4317
4317
{
4318
4318
    mTestParticleName = fileName;
4319
4319
    mTestParticleTime = cur_time;