aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2002-12-01 13:06:15 +0000
committerMax Horn2002-12-01 13:06:15 +0000
commit7816787744488fc3d807ef9b3c6d76b4bb9aee88 (patch)
tree7dc860aeb1998bc96a6499b7c1ada7b6168d0abe /scumm
parent37c0b1be55aa63fc2fb56244a106736f52ccef3b (diff)
downloadscummvm-rg350-7816787744488fc3d807ef9b3c6d76b4bb9aee88.tar.gz
scummvm-rg350-7816787744488fc3d807ef9b3c6d76b4bb9aee88.tar.bz2
scummvm-rg350-7816787744488fc3d807ef9b3c6d76b4bb9aee88.zip
added some warnings to ease debugging
svn-id: r5772
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v1.cpp62
1 files changed, 52 insertions, 10 deletions
diff --git a/scumm/script_v1.cpp b/scumm/script_v1.cpp
index 85a6c3bafe..cbf17a5a60 100644
--- a/scumm/script_v1.cpp
+++ b/scumm/script_v1.cpp
@@ -886,40 +886,82 @@ void Scumm::o5_freezeScripts()
void Scumm::o5_getActorCostume()
{
+ int act;
+ Actor *a;
getResultPos();
- setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorCostume")->costume);
+ act = getVarOrDirectByte(0x80);
+
+ a = derefActorSafe(act, "o5_getActorCostume");
+ if (!a) {
+ warning("Invalid actor %d in o5_getActorCostume", act);
+ return;
+ }
+
+ setResult(a->costume);
}
void Scumm::o5_getActorElevation()
{
+ int act;
+ Actor *a;
getResultPos();
- setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorElevation")->elevation);
+ act = getVarOrDirectByte(0x80);
+
+ a = derefActorSafe(act, "o5_getActorElevation");
+ if (!a) {
+ warning("Invalid actor %d in o5_getActorElevation", act);
+ return;
+ }
+
+ setResult(a->elevation);
}
void Scumm::o5_getActorFacing()
{
+ int act;
+ Actor *a;
getResultPos();
- setResult(newDirToOldDir(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorFacing")->facing));
+ act = getVarOrDirectByte(0x80);
+
+ a = derefActorSafe(act, "o5_getActorFacing");
+ if (!a) {
+ warning("Invalid actor %d in o5_getActorFacing", act);
+ return;
+ }
+
+ setResult(a->facing);
}
void Scumm::o5_getActorMoving()
{
+ int act;
+ Actor *a;
getResultPos();
- setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorMoving")->moving);
+ act = getVarOrDirectByte(0x80);
+
+ a = derefActorSafe(act, "o5_getActorMoving");
+ if (!a) {
+ warning("Invalid actor %d in o5_getActorMoving", act);
+ return;
+ }
+
+ setResult(a->moving);
}
void Scumm::o5_getActorRoom()
{
- int temp;
- Actor *act;
+ int act;
+ Actor *a;
getResultPos();
- temp = getVarOrDirectByte(0x80);
+ act = getVarOrDirectByte(0x80);
- act = derefActorSafe(temp, "o5_getActorRoom");
- if (!act)
+ a = derefActorSafe(act, "o5_getActorRoom");
+ if (!a) {
+ warning("Invalid actor %d in o5_getActorRoom", act);
return;
+ }
- setResult(act->room);
+ setResult(a->room);
}
void Scumm::o5_getActorScale()