use int for get loop
This commit is contained in:
parent
136dceae44
commit
08b29ea864
2 changed files with 3 additions and 4 deletions
|
@ -8,9 +8,8 @@ std::vector<GameObject*>& GameObject::GetChildren() {
|
|||
|
||||
GameObject& GameObject::Get(std::string name) {
|
||||
// NOTE(hippoz): This is a mess.
|
||||
// Firstly, I should be using find_if, not a loop
|
||||
// Secondly, why is this a short?
|
||||
for (short i = this->children.size()-1; i >= 0; i--) {
|
||||
// I should be using find_if, not a loop
|
||||
for (int i = this->children.size()-1; i >= 0; i--) {
|
||||
if (this->children[i]->name == name) {
|
||||
return *this->children[i];
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ int main() {
|
|||
int ret = luaL_dofile(L, "Script.lua");
|
||||
|
||||
if (ret != 0) {
|
||||
std::cout << "[E] Error running main script." << '\n';
|
||||
std::cout << "[E] Error running main script" << '\n';
|
||||
std::cout << " -> " << lua_tostring(L, -1) << '\n';
|
||||
return 2;
|
||||
}
|
||||
|
|
Reference in a new issue