mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-25 07:02:47 -04:00
JAUSoundTable-related crash fix
This commit is contained in:
@@ -15,6 +15,11 @@ void JAUSoundTable::init(void const* param_0) {
|
||||
}
|
||||
|
||||
u8 JAUSoundTable::getTypeID(JAISoundID param_0) const {
|
||||
#if TARGET_PC
|
||||
if (this == NULL) {
|
||||
return 0xff;
|
||||
}
|
||||
#endif
|
||||
if (param_0.isAnonymous()) {
|
||||
return 0xff;
|
||||
}
|
||||
@@ -30,6 +35,11 @@ u8 JAUSoundTable::getTypeID(JAISoundID param_0) const {
|
||||
}
|
||||
|
||||
JAUSoundTableItem* JAUSoundTable::getData(JAISoundID param_0) const {
|
||||
#if TARGET_PC
|
||||
if (this == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
if (param_0.isAnonymous()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1718,11 +1718,16 @@ void Z2SceneMgr::setSceneName(char* spot, s32 room, s32 layer) {
|
||||
|
||||
if (Z2GetSoundMgr()->getStreamMgr()->isActive()) {
|
||||
JAUSoundTable* sound_table = JAUSoundTable::getInstance();
|
||||
JSUList<JAIStream>* stream_list = Z2GetSoundMgr()->getStreamMgr()->getStreamList();
|
||||
JSULink<JAIStream>* stream;
|
||||
for (stream = stream_list->getFirst(); stream != NULL; stream = stream->getNext()) {
|
||||
if (bVar2 || sound_table->getTypeID(stream->getObject()->getID()) != 0x71) {
|
||||
stream->getObject()->stop(Z2Param::SCENE_CHANGE_BGM_FADEOUT_TIME);
|
||||
#if TARGET_PC
|
||||
if (sound_table->isValid())
|
||||
#endif
|
||||
{
|
||||
JSUList<JAIStream>* stream_list = Z2GetSoundMgr()->getStreamMgr()->getStreamList();
|
||||
JSULink<JAIStream>* stream;
|
||||
for (stream = stream_list->getFirst(); stream != NULL; stream = stream->getNext()) {
|
||||
if (bVar2 || sound_table->getTypeID(stream->getObject()->getID()) != 0x71) {
|
||||
stream->getObject()->stop(Z2Param::SCENE_CHANGE_BGM_FADEOUT_TIME);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user