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

« back to all changes in this revision

Viewing changes to src/resources/beinginfo.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:
77
77
    delete_all(mDisplay.sprites);
78
78
}
79
79
 
80
 
void BeingInfo::setDisplay(SpriteDisplay display)
 
80
void BeingInfo::setDisplay(const SpriteDisplay &display)
81
81
{
82
82
    mDisplay = display;
83
83
}
119
119
    static SoundInfo emptySound("", 0);
120
120
 
121
121
    const SoundEvents::const_iterator i = mSounds.find(event);
122
 
    return (i == mSounds.end() || !i->second || i->second->empty())
123
 
        ? emptySound : i->second->at(rand() % i->second->size());
 
122
 
 
123
    if (i == mSounds.end())
 
124
        return emptySound;
 
125
 
 
126
    const SoundInfoVect *const vect = i->second;
 
127
    if (!vect || vect->empty())
 
128
        return emptySound;
 
129
    else
 
130
        return vect->at(rand() % vect->size());
124
131
}
125
132
 
126
133
const Attack *BeingInfo::getAttack(const int id) const