Make players invincible to pvp attacks on area load
This commit is contained in:
parent
8bc0abb6a2
commit
bac952c370
|
@ -251,6 +251,7 @@ void clear_area_graph_nodes(void) {
|
||||||
void load_area(s32 index) {
|
void load_area(s32 index) {
|
||||||
if (gCurrentArea == NULL && gAreaData[index].unk04 != NULL) {
|
if (gCurrentArea == NULL && gAreaData[index].unk04 != NULL) {
|
||||||
gCurrentArea = &gAreaData[index];
|
gCurrentArea = &gAreaData[index];
|
||||||
|
gCurrentArea->localAreaTimer = 0;
|
||||||
gCurrAreaIndex = gCurrentArea->index;
|
gCurrAreaIndex = gCurrentArea->index;
|
||||||
|
|
||||||
if (gCurrentArea->terrainData != NULL) {
|
if (gCurrentArea->terrainData != NULL) {
|
||||||
|
|
|
@ -81,6 +81,7 @@ struct Area
|
||||||
/*0x38*/ u16 musicParam2;
|
/*0x38*/ u16 musicParam2;
|
||||||
/*????*/ u8 cachedBehaviors[256];
|
/*????*/ u8 cachedBehaviors[256];
|
||||||
/*????*/ Vec3f cachedPositions[256];
|
/*????*/ Vec3f cachedPositions[256];
|
||||||
|
/*????*/ u32 localAreaTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
// All the transition data to be used in screen_transition.c
|
// All the transition data to be used in screen_transition.c
|
||||||
|
|
|
@ -1346,6 +1346,11 @@ u32 interact_player(struct MarioState* m, UNUSED u32 interactType, struct Object
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// don't attack each other on level load
|
||||||
|
if (gCurrentArea == NULL || gCurrentArea->localAreaTimer < 60) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
u32 interaction = determine_interaction(m, o);
|
u32 interaction = determine_interaction(m, o);
|
||||||
|
|
||||||
// attacked
|
// attacked
|
||||||
|
|
|
@ -1309,6 +1309,10 @@ s32 update_level(void) {
|
||||||
return changeLevel;
|
return changeLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gCurrentArea != NULL) {
|
||||||
|
gCurrentArea->localAreaTimer++;
|
||||||
|
}
|
||||||
|
|
||||||
switch (sCurrPlayMode) {
|
switch (sCurrPlayMode) {
|
||||||
case PLAY_MODE_NORMAL:
|
case PLAY_MODE_NORMAL:
|
||||||
changeLevel = play_mode_normal();
|
changeLevel = play_mode_normal();
|
||||||
|
|
Loading…
Reference in New Issue