diff options
Diffstat (limited to 'linden/indra/newview/llagentpilot.cpp')
-rw-r--r-- | linden/indra/newview/llagentpilot.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/linden/indra/newview/llagentpilot.cpp b/linden/indra/newview/llagentpilot.cpp index b4a1d86..f2a1903 100644 --- a/linden/indra/newview/llagentpilot.cpp +++ b/linden/indra/newview/llagentpilot.cpp | |||
@@ -45,22 +45,28 @@ LLAgentPilot gAgentPilot; | |||
45 | 45 | ||
46 | BOOL LLAgentPilot::sLoop = TRUE; | 46 | BOOL LLAgentPilot::sLoop = TRUE; |
47 | 47 | ||
48 | LLAgentPilot::LLAgentPilot() | 48 | LLAgentPilot::LLAgentPilot() : |
49 | mNumRuns(-1), | ||
50 | mQuitAfterRuns(FALSE), | ||
51 | mRecording(FALSE), | ||
52 | mLastRecordTime(0.f), | ||
53 | mStarted(FALSE), | ||
54 | mPlaying(FALSE), | ||
55 | mCurrentAction(0) | ||
49 | { | 56 | { |
50 | mRecording = FALSE; | ||
51 | mPlaying = FALSE; | ||
52 | mStarted = FALSE; | ||
53 | mNumRuns = -1; | ||
54 | } | 57 | } |
55 | 58 | ||
56 | LLAgentPilot::~LLAgentPilot() | 59 | LLAgentPilot::~LLAgentPilot() |
57 | { | 60 | { |
58 | } | 61 | } |
59 | 62 | ||
60 | void LLAgentPilot::load(const char *filename) | 63 | void LLAgentPilot::load(const std::string& filename) |
61 | { | 64 | { |
62 | if(!filename) return; | 65 | if(filename.empty()) |
63 | 66 | { | |
67 | return; | ||
68 | } | ||
69 | |||
64 | llifstream file(filename); | 70 | llifstream file(filename); |
65 | 71 | ||
66 | if (!file) | 72 | if (!file) |
@@ -78,8 +84,7 @@ void LLAgentPilot::load(const char *filename) | |||
78 | 84 | ||
79 | file >> num_actions; | 85 | file >> num_actions; |
80 | 86 | ||
81 | S32 i; | 87 | for (S32 i = 0; i < num_actions; i++) |
82 | for (i = 0; i < num_actions; i++) | ||
83 | { | 88 | { |
84 | S32 action_type; | 89 | S32 action_type; |
85 | Action new_action; | 90 | Action new_action; |
@@ -92,10 +97,10 @@ void LLAgentPilot::load(const char *filename) | |||
92 | file.close(); | 97 | file.close(); |
93 | } | 98 | } |
94 | 99 | ||
95 | void LLAgentPilot::save(const char *filename) | 100 | void LLAgentPilot::save(const std::string& filename) |
96 | { | 101 | { |
97 | llofstream file; | 102 | llofstream file; |
98 | file.open(filename); /*Flawfinder: ignore*/ | 103 | file.open(filename); |
99 | 104 | ||
100 | if (!file) | 105 | if (!file) |
101 | { | 106 | { |
@@ -125,7 +130,7 @@ void LLAgentPilot::startRecord() | |||
125 | void LLAgentPilot::stopRecord() | 130 | void LLAgentPilot::stopRecord() |
126 | { | 131 | { |
127 | gAgentPilot.addAction(STRAIGHT); | 132 | gAgentPilot.addAction(STRAIGHT); |
128 | gAgentPilot.save(gSavedSettings.getString("StatsPilotFile").c_str()); | 133 | gAgentPilot.save(gSavedSettings.getString("StatsPilotFile")); |
129 | mRecording = FALSE; | 134 | mRecording = FALSE; |
130 | } | 135 | } |
131 | 136 | ||