mirror of
https://github.com/pmret/papermario.git
synced 2024-11-09 20:42:41 +01:00
Added proper return types to a few script functions. Use ptrReadPos++ in places where it's not stricly necessary, but good practice.
This commit is contained in:
parent
7beaf4c461
commit
01ecc1dd24
@ -6,7 +6,7 @@ INCLUDE_ASM(code_f2470_len_27f0, set_npc_animation);
|
||||
|
||||
s32 DeleteNpc(script_context* script, s32 initialCall) {
|
||||
bytecode* ptrReadPos = script->ptrReadPos;
|
||||
npc* npcPtr = get_npc_unsafe(get_variable(script, *ptrReadPos));
|
||||
npc* npcPtr = get_npc_unsafe(get_variable(script, *ptrReadPos++));
|
||||
|
||||
if (npcPtr) {
|
||||
free_npc(npcPtr);
|
||||
@ -18,7 +18,7 @@ s32 DeleteNpc(script_context* script, s32 initialCall) {
|
||||
s32 GetNpcPointer(script_context* script, s32 initialCall) {
|
||||
bytecode* ptrReadPos = script->ptrReadPos;
|
||||
bytecode npcID = get_variable(script, *ptrReadPos++);
|
||||
bytecode varNPC = *ptrReadPos;
|
||||
bytecode varNPC = *ptrReadPos++;
|
||||
|
||||
set_variable(script, varNPC, get_npc_safe(npcID));
|
||||
return 2;
|
||||
|
@ -1,19 +1,19 @@
|
||||
#include "common.h"
|
||||
|
||||
void SpeakToPlayer(script_context* script, s32 initialCall) {
|
||||
_show_message(script, initialCall, 0);
|
||||
s32 SpeakToPlayer(script_context* script, s32 initialCall) {
|
||||
return _show_message(script, initialCall, 0);
|
||||
}
|
||||
|
||||
void EndSpeech(script_context* script, s32 initialCall) {
|
||||
_show_message(script, initialCall, 1);
|
||||
s32 EndSpeech(script_context* script, s32 initialCall) {
|
||||
return _show_message(script, initialCall, 1);
|
||||
}
|
||||
|
||||
void ContinueSpeech(script_context* script, s32 initialCall) {
|
||||
_show_message(script, initialCall, 2);
|
||||
s32 ContinueSpeech(script_context* script, s32 initialCall) {
|
||||
return _show_message(script, initialCall, 2);
|
||||
}
|
||||
|
||||
void SpeakToNpc(script_context* script, s32 initialCall) {
|
||||
_show_message(script, initialCall, 3);
|
||||
s32 SpeakToNpc(script_context* script, s32 initialCall) {
|
||||
return _show_message(script, initialCall, 3);
|
||||
}
|
||||
|
||||
INCLUDE_ASM(code_f4c60_len_4300, _show_message);
|
||||
@ -60,7 +60,7 @@ s32 func_802D0C94(script_context* script, s32 initialCall) {
|
||||
s32 SetMessageString(script_context* script, s32 initialCall) {
|
||||
bytecode* ptrReadPos = script->ptrReadPos;
|
||||
bytecode string = get_variable(script, *ptrReadPos++);
|
||||
bytecode index = get_variable(script, *ptrReadPos);
|
||||
bytecode index = get_variable(script, *ptrReadPos++);
|
||||
|
||||
set_message_string(string, index);
|
||||
return 2;
|
||||
|
Loading…
Reference in New Issue
Block a user