Ignore kUnload calls which are not made with less than 2 parameters. Apparently, according to the FreeSCI bugs list, SQ1 calls it with 1 parameter when exiting the Ulence flats bar
svn-id: r47563
This commit is contained in:
parent
326d64d07d
commit
e0293562de
1 changed files with 11 additions and 4 deletions
|
@ -73,11 +73,18 @@ reg_t kLock(EngineState *s, int argc, reg_t *argv) {
|
|||
|
||||
// Unloads an arbitrary resource of type 'restype' with resource numbber 'resnr'
|
||||
reg_t kUnLoad(EngineState *s, int argc, reg_t *argv) {
|
||||
int restype = argv[0].toUint16();
|
||||
reg_t resnr = argv[1];
|
||||
if (argc >= 2) {
|
||||
int restype = argv[0].toUint16();
|
||||
reg_t resnr = argv[1];
|
||||
|
||||
if (restype == kResourceTypeMemory)
|
||||
kfree(s->_segMan, resnr);
|
||||
if (restype == kResourceTypeMemory)
|
||||
kfree(s->_segMan, resnr);
|
||||
|
||||
if (argc > 2)
|
||||
warning("kUnload called with more than 2 parameters (%d)", argc);
|
||||
} else {
|
||||
warning("kUnload called with %d arguments - ignoring", argc);
|
||||
}
|
||||
|
||||
return s->r_acc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue