Skip to content

Document Field Warp animations and transition#942

Merged
lhearachel merged 2 commits intopret:mainfrom
VicSevenT:field_warp
Feb 16, 2026
Merged

Document Field Warp animations and transition#942
lhearachel merged 2 commits intopret:mainfrom
VicSevenT:field_warp

Conversation

@VicSevenT
Copy link
Contributor

The file field_warp.c handles the spinning animation and map transition that occurs when using Dig, Teleport, or an Escape Rope. Along with this documentation, I found that a series of functions in field_map_change.c that were associated with Dig could actually be called from any of the 3 warp types, and so updated their names as well.

Copy link
Collaborator

@lhearachel lhearachel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few polish-bits to take care of.

}

void FieldTask_ChangeMapChangeByDig(FieldTask *task, const Location *location, u32 param2)
void FieldTask_ChangeMapChangeByFieldWarp(FieldTask *task, const Location *location, enum FieldWarpType fieldWarpType)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: ChangeMapByFieldWarp

if (mapChangeData->fieldWarpType == FIELD_WARP_TYPE_TELEPORT) {
FieldSystem_SetTeleportFlags(fieldSystem);
} else if ((mapChangeData->unk_04 == 0) || (mapChangeData->unk_04 == 1)) {
} else if ((mapChangeData->fieldWarpType == FIELD_WARP_TYPE_ESCAPE_ROPE) || (mapChangeData->fieldWarpType == FIELD_WARP_TYPE_DIG)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

polish: Remove extraneous parens.


Heap_Free(v1);
FieldTask_InitJump(param0, ov6_02247554, v2);
FieldTask_InitJump(param0, FieldWarp_TeleportFadeOut, fieldWarp);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

polish: Just for completeness, let's name param0 in the FieldTask functions that you're handling here.

#ifndef POKEPLATINUM_FIELD_WARP_H
#define POKEPLATINUM_FIELD_WARP_H

#include "struct_decls/struct_02061AB4_decl.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Out of scope for your PR, but we should really clean up the MapObject struct declarations.

@lhearachel lhearachel self-assigned this Feb 15, 2026
@lhearachel lhearachel merged commit 90791df into pret:main Feb 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants