From d7bc94e810942fc50fcafed74a9610754644576c Mon Sep 17 00:00:00 2001 From: Oliver Kiehl Date: Sat, 24 May 2003 18:56:19 +0000 Subject: add fnInteract svn-id: r7898 --- sky/logic.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sky') diff --git a/sky/logic.cpp b/sky/logic.cpp index 7f352c4f01..a0b4a82843 100644 --- a/sky/logic.cpp +++ b/sky/logic.cpp @@ -1092,8 +1092,18 @@ uint32 SkyLogic::fnIdle(uint32 a, uint32 b, uint32 c) { error("Stub: fnIdle"); } -uint32 SkyLogic::fnInteract(uint32 a, uint32 b, uint32 c) { - error("Stub: fnInteract"); +uint32 SkyLogic::fnInteract(uint32 targetId, uint32 b, uint32 c) { + _compact->mode += 4; // next level up + _compact->logic = L_SCRIPT; + Compact *cpt = SkyState::fetchCompact(targetId); + + uint16 *scriptNo = (uint16 *)SkyCompact::getCompactElem(_compact, C_BASE_SUB + _compact->mode); + uint16 *offset = (uint16 *)SkyCompact::getCompactElem(_compact, C_BASE_SUB + _compact->mode + 2); + + *scriptNo = cpt->actionScript; + *offset = 0; + + return 0; } uint32 SkyLogic::fnStartSub(uint32 a, uint32 b, uint32 c) { -- cgit v1.2.3