Handle missing arg exception and set precision to 6
This commit is contained in:
parent
957e262560
commit
fc711448d8
@ -33,9 +33,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
EntityConverter::EntityConverter (const std::string &entityMapFile) :
|
EntityConverter::EntityConverter (const std::string &entityMapFile)
|
||||||
OFFSET_PLAYER(32.0), OFFSET_PICKUP(2.0), BRIGHTNESS_ADJUST(50.0),
|
: OFFSET_PLAYER(32.0),
|
||||||
OUTPUT_PRECISION(10)
|
OFFSET_PICKUP(2.0),
|
||||||
|
BRIGHTNESS_ADJUST(50.0),
|
||||||
|
OUTPUT_PRECISION(6)
|
||||||
{
|
{
|
||||||
//MUST RUN extractMapInfo method after this constructor
|
//MUST RUN extractMapInfo method after this constructor
|
||||||
haveMapInfo_ = false;
|
haveMapInfo_ = false;
|
||||||
@ -53,7 +55,7 @@ EntityConverter::EntityConverter (const std::string &entityMapFile) :
|
|||||||
|
|
||||||
EntityConverter::EntityConverter (const std::string &entityMapFile,
|
EntityConverter::EntityConverter (const std::string &entityMapFile,
|
||||||
const std::string &reflexMapFile) : OFFSET_PLAYER(32.0),
|
const std::string &reflexMapFile) : OFFSET_PLAYER(32.0),
|
||||||
OFFSET_PICKUP(2.0), BRIGHTNESS_ADJUST(50.0), OUTPUT_PRECISION(10)
|
OFFSET_PICKUP(2.0), BRIGHTNESS_ADJUST(50.0), OUTPUT_PRECISION(6)
|
||||||
{
|
{
|
||||||
haveMapInfo_ = false;
|
haveMapInfo_ = false;
|
||||||
// game modes default to enabled
|
// game modes default to enabled
|
||||||
|
13
src/main.cpp
13
src/main.cpp
@ -126,11 +126,22 @@ void convert_entities(const cxxopts::Options &o, const vector<vector<string> > &
|
|||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
cxxopts::Options p = arguments(argc, argv);
|
cxxopts::Options p = arguments(argc, argv);
|
||||||
|
|
||||||
vector<vector<string> > entities;
|
vector<vector<string> > entities;
|
||||||
bool is_ok = convert_worldspawn(p, entities);
|
bool is_ok = convert_worldspawn(p, entities);
|
||||||
// print_entities(entities);
|
// print_entities(entities);
|
||||||
convert_entities(p, entities);
|
convert_entities(p, entities);
|
||||||
|
}
|
||||||
|
catch (cxxopts::option_not_exists_exception e) {
|
||||||
|
cerr << e.what() << endl
|
||||||
|
<< "./reflex2q3 -h for usage information" << endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
catch (std::exception &e) {
|
||||||
|
cerr << e.what() << endl;
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user