help to non-existing command + audio fix
This commit is contained in:
+6
-5
@@ -255,16 +255,17 @@ speakerid_t audio::play(
|
|||||||
sound = sound->variants.at(index).get();
|
sound = sound->variants.at(index).get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto speaker = sound->newInstance(priority, channel);
|
auto speaker_ptr = sound->newInstance(priority, channel);
|
||||||
if (speaker == nullptr) {
|
if (speaker_ptr == nullptr) {
|
||||||
remove_lower_priority_speaker(priority);
|
remove_lower_priority_speaker(priority);
|
||||||
speaker = sound->newInstance(priority, channel);
|
speaker_ptr = sound->newInstance(priority, channel);
|
||||||
}
|
}
|
||||||
if (speaker == nullptr) {
|
if (speaker_ptr == nullptr) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
auto speaker = speaker_ptr.get();
|
||||||
speakerid_t id = nextId++;
|
speakerid_t id = nextId++;
|
||||||
speakers.emplace(id, std::move(speaker));
|
speakers.emplace(id, std::move(speaker_ptr));
|
||||||
speaker->setPosition(position);
|
speaker->setPosition(position);
|
||||||
speaker->setVolume(volume);
|
speaker->setVolume(volume);
|
||||||
speaker->setPitch(pitch);
|
speaker->setPitch(pitch);
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ static int l_get_command_info(lua_State* L) {
|
|||||||
auto interpreter = engine->getCommandsInterpreter();
|
auto interpreter = engine->getCommandsInterpreter();
|
||||||
auto repo = interpreter->getRepository();
|
auto repo = interpreter->getRepository();
|
||||||
auto command = repo->get(name);
|
auto command = repo->get(name);
|
||||||
|
if (command == nullptr) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
const auto& args = command->getArgs();
|
const auto& args = command->getArgs();
|
||||||
const auto& kwargs = command->getKwArgs();
|
const auto& kwargs = command->getKwArgs();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user