|
@@ -141,11 +141,19 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
|
141
|
141
|
} else if (strcmp(command, "quit") == 0) {
|
142
|
142
|
exit(0);
|
143
|
143
|
} else if (strcmp(command, "load") == 0) {
|
|
144
|
+ if (!mRunning) {
|
|
145
|
+ getConsole().print("Use load command interactively!");
|
|
146
|
+ return -999;
|
|
147
|
+ }
|
144
|
148
|
char *tmp = bufferString("%s/%s", mPakDir, args->at(0));
|
145
|
149
|
int error = getGame().loadLevel(tmp);
|
146
|
150
|
delete [] tmp;
|
147
|
151
|
return error;
|
148
|
152
|
} else if (strcmp(command, "sshot") == 0) {
|
|
153
|
+ if (!mRunning) {
|
|
154
|
+ getConsole().print("Use sshot command interactively!");
|
|
155
|
+ return -999;
|
|
156
|
+ }
|
149
|
157
|
char *filename = bufferString("%s/sshots/%s", mBaseDir, VERSION);
|
150
|
158
|
bool console = (args->size() > 0) && (strcmp(args->at(0), "console") == 0);
|
151
|
159
|
bool menu = (args->size() > 0) && (strcmp(args->at(0), "menu") == 0);
|
|
@@ -211,6 +219,10 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
|
211
|
219
|
return -8;
|
212
|
220
|
}
|
213
|
221
|
} else if (strcmp(command, "move") == 0) {
|
|
222
|
+ if (!mRunning) {
|
|
223
|
+ getConsole().print("Use move command interactively!");
|
|
224
|
+ return -999;
|
|
225
|
+ }
|
214
|
226
|
if (args->size() > 0) {
|
215
|
227
|
if (getGame().mLoaded) {
|
216
|
228
|
char *move = args->at(0);
|
|
@@ -236,6 +248,10 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
|
236
|
248
|
return -11;
|
237
|
249
|
}
|
238
|
250
|
} else if (strcmp(command, "sound") == 0) {
|
|
251
|
+ if ((!mRunning) || (!getGame().mLoaded)) {
|
|
252
|
+ getConsole().print("Use sound command interactively!");
|
|
253
|
+ return -999;
|
|
254
|
+ }
|
239
|
255
|
if (args->size() > 0) {
|
240
|
256
|
getSound().play(atoi(args->at(0)));
|
241
|
257
|
} else {
|
|
@@ -243,6 +259,10 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
|
243
|
259
|
return -12;
|
244
|
260
|
}
|
245
|
261
|
} else if (strcmp(command, "animate") == 0) {
|
|
262
|
+ if ((!mRunning) || (!getGame().mLoaded)) {
|
|
263
|
+ getConsole().print("Use animate command interactively!");
|
|
264
|
+ return -999;
|
|
265
|
+ }
|
246
|
266
|
if (args->size() > 0) {
|
247
|
267
|
char c = args->at(0)[0];
|
248
|
268
|
if (c == 'n') {
|
|
@@ -340,6 +360,10 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
|
340
|
360
|
return -20;
|
341
|
361
|
}
|
342
|
362
|
} else if (strcmp(command, "viewmodel") == 0) {
|
|
363
|
+ if ((!mRunning) || (!getGame().mLoaded)) {
|
|
364
|
+ getConsole().print("Use viewmodel command interactively!");
|
|
365
|
+ return -999;
|
|
366
|
+ }
|
343
|
367
|
if (getGame().mLara) {
|
344
|
368
|
SkeletalModel *smdl = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
|
345
|
369
|
skeletal_model_t *mdl = getWorld().getModel(atoi(args->at(0)));
|
|
@@ -550,6 +574,10 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
|
550
|
574
|
return -45;
|
551
|
575
|
}
|
552
|
576
|
} else if (strcmp(command, "pigtail") == 0) {
|
|
577
|
+ if ((!mRunning) || (!getGame().mLoaded)) {
|
|
578
|
+ getConsole().print("Use pigtail command interactively!");
|
|
579
|
+ return -999;
|
|
580
|
+ }
|
553
|
581
|
if (args->size() > 0) {
|
554
|
582
|
bool b;
|
555
|
583
|
if (readBool(args->at(0), &b) < 0) {
|
|
@@ -571,6 +599,10 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
|
571
|
599
|
return -47;
|
572
|
600
|
}
|
573
|
601
|
} else if (strcmp(command, "ponypos") == 0) {
|
|
602
|
+ if ((!mRunning) || (!getGame().mLoaded)) {
|
|
603
|
+ getConsole().print("Use ponypos command interactively!");
|
|
604
|
+ return -999;
|
|
605
|
+ }
|
574
|
606
|
if (args->size() > 3) {
|
575
|
607
|
SkeletalModel *tmp = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
|
576
|
608
|
tmp->model->ponytail[0] = (float)atof(args->at(0));
|