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) {
|
GameObject& GameObject::Get(std::string name) {
|
||||||
// NOTE(hippoz): This is a mess.
|
// NOTE(hippoz): This is a mess.
|
||||||
// Firstly, I should be using find_if, not a loop
|
// I should be using find_if, not a loop
|
||||||
// Secondly, why is this a short?
|
for (int i = this->children.size()-1; i >= 0; i--) {
|
||||||
for (short i = this->children.size()-1; i >= 0; i--) {
|
|
||||||
if (this->children[i]->name == name) {
|
if (this->children[i]->name == name) {
|
||||||
return *this->children[i];
|
return *this->children[i];
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ int main() {
|
||||||
int ret = luaL_dofile(L, "Script.lua");
|
int ret = luaL_dofile(L, "Script.lua");
|
||||||
|
|
||||||
if (ret != 0) {
|
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';
|
std::cout << " -> " << lua_tostring(L, -1) << '\n';
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue