use int for get loop

This commit is contained in:
hippoz 2021-03-25 20:23:41 +02:00
parent 136dceae44
commit 08b29ea864
Signed by: hippoz
GPG key ID: 7C52899193467641
2 changed files with 3 additions and 4 deletions

View file

@ -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];
}

View file

@ -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;
}