CORE: fixed an issue with CLuaBaseEntity::wait