Be more tolerant of invalid arguments

FossilOrigin-Name: d2f07d884a4f4319ff687e085c3233e210ee05b46a2675ecd757a261e6f19e6e
This commit is contained in:
Jonathan Schleifer 2025-03-12 00:16:05 +00:00
parent f1968ce5af
commit 38747afbb5
12 changed files with 112 additions and 88 deletions

View file

@ -3,6 +3,7 @@
#include "cube.h"
#import "DynamicEntity.h"
#import "OFString+Cube.h"
#import "Projectile.h"
static const int MONSTERDAMAGEFACTOR = 4;
@ -63,9 +64,9 @@ reloadtime(int gun)
void
weapon(OFString *a1, OFString *a2, OFString *a3)
{
selectgun((a1.length > 0 ? a1.intValue : -1),
(a2.length > 0 ? a2.intValue : -1),
(a3.length > 0 ? a3.intValue : -1));
selectgun((a1.length > 0 ? a1.cube_intValue : -1),
(a2.length > 0 ? a2.cube_intValue : -1),
(a3.length > 0 ? a3.cube_intValue : -1));
}
COMMAND(weapon, ARG_3STR)