Remove useless import,add exception catch
This commit is contained in:
parent
c2c6dec531
commit
cc5b550cef
11
main.cpp
11
main.cpp
|
@ -1,6 +1,5 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "cwmods/cwmods.h"
|
#include "cwmods/cwmods.h"
|
||||||
#include "cwmods/common/LongVector3.h"
|
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -59,8 +58,12 @@ void InitHomeMap(){
|
||||||
std::string x = elements.at(1);
|
std::string x = elements.at(1);
|
||||||
std::string y = elements.at(2);
|
std::string y = elements.at(2);
|
||||||
std::string z = elements.at(3);
|
std::string z = elements.at(3);
|
||||||
std::vector<long long> coords {std::stoll(x), std::stoll(y), std::stoll(z)};
|
try {
|
||||||
home_map[name] = coords;
|
std::vector<long long> coords {std::stoll(x), std::stoll(y), std::stoll(z)};
|
||||||
|
home_map[name] = coords;
|
||||||
|
} catch ( ... ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -393,4 +396,4 @@ EXPORT HandleP2PRequest(long long steamID) {
|
||||||
|
|
||||||
EXPORT void ModInitialize() {
|
EXPORT void ModInitialize() {
|
||||||
InitHomeMap();
|
InitHomeMap();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue