Changed: #1469 Getting rid of a variable

--HG--
branch : gsoc2012-fabien
hg/feature/gsoc2012-fabien
Fabien_HENON 13 years ago
parent a1c8c9dc8a
commit ec6af57aa6

@ -61,14 +61,12 @@ CAMERA_ANIMATION_REGISTR_MODIFIER(CCameraAnimationModifierShake, "camera_modifie
class CCameraAnimationModifierSoundTrigger : public ICameraAnimationModifier class CCameraAnimationModifierSoundTrigger : public ICameraAnimationModifier
{ {
protected: protected:
std::string SoundName;
std::string SoundPos; std::string SoundPos;
NLMISC::CSheetId SoundId; NLMISC::CSheetId SoundId;
public: public:
CCameraAnimationModifierSoundTrigger() CCameraAnimationModifierSoundTrigger()
{ {
SoundName = "";
SoundPos = ""; SoundPos = "";
SoundId = NLMISC::CSheetId::Unknown; SoundId = NLMISC::CSheetId::Unknown;
} }
@ -83,11 +81,10 @@ public:
nlwarning("<CCameraAnimationModifierSoundTrigger parseModifier> impossible to get the sound_name property of the basic modifier in primitive : %s", filename.c_str()); nlwarning("<CCameraAnimationModifierSoundTrigger parseModifier> impossible to get the sound_name property of the basic modifier in primitive : %s", filename.c_str());
return false; return false;
} }
SoundName = value; SoundId = NLMISC::CSheetId(value);
SoundId = NLMISC::CSheetId(SoundName);
if (SoundId == NLMISC::CSheetId::Unknown) if (SoundId == NLMISC::CSheetId::Unknown)
{ {
nlwarning("<CCameraAnimationModifierSoundTrigger parseModifier> sheetid not found for sound name %s in the basic modifier in primitive : %s", SoundName.c_str(), filename.c_str()); nlwarning("<CCameraAnimationModifierSoundTrigger parseModifier> sheetid not found for sound name %s in the basic modifier in primitive : %s", value.c_str(), filename.c_str());
return false; return false;
} }
// We get the sound position // We get the sound position

@ -5443,13 +5443,13 @@ class CMissionActionSoundTrigger : public IMissionAction
return false; return false;
} }
_SoundName = script[1]; std::string SoundName = script[1];
if (script.size() >= 3) if (script.size() >= 3)
_SoundPosition = script[2]; _SoundPosition = script[2];
else else
_SoundPosition = ""; _SoundPosition = "";
_SoundId = NLMISC::CSheetId(_SoundName); _SoundId = NLMISC::CSheetId(SoundName);
if (_SoundId == NLMISC::CSheetId::Unknown) if (_SoundId == NLMISC::CSheetId::Unknown)
{ {
MISLOGSYNTAXERROR("sound_trigger action: sheetid not found"); MISLOGSYNTAXERROR("sound_trigger action: sheetid not found");
@ -5465,7 +5465,6 @@ class CMissionActionSoundTrigger : public IMissionAction
// We tell the client to play the sound // We tell the client to play the sound
}; };
std::string _SoundName;
std::string _SoundPosition; std::string _SoundPosition;
NLMISC::CSheetId _SoundId; NLMISC::CSheetId _SoundId;

Loading…
Cancel
Save