mirror of
https://github.com/pret/pmd-red.git
synced 2026-09-10 18:15:45 -05:00
merge dungeon leader - dungeon range
This commit is contained in:
@@ -275,7 +275,6 @@ SECTIONS {
|
||||
src/trap.o(.text);
|
||||
src/dungeon_serializer.o(.text);
|
||||
src/dungeon_range.o(.text);
|
||||
src/dungeon_leader.o(.text);
|
||||
asm/code_8083654.o(.text);
|
||||
src/dungeon_music.o(.text);
|
||||
src/dungeon_random.o(.text);
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "structs/str_dungeon.h"
|
||||
#include "dungeon_leader.h"
|
||||
#include "dungeon_util.h"
|
||||
|
||||
EWRAM_INIT Entity *gLeaderPointer = NULL;
|
||||
|
||||
Entity* GetLeader(void)
|
||||
{
|
||||
Entity *leader = gLeaderPointer;
|
||||
if (leader == NULL)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < MAX_TEAM_MEMBERS; i++)
|
||||
{
|
||||
Entity *currentPokemon = gDungeon->teamPokemon[i];
|
||||
if (EntityIsValid(currentPokemon) && GetEntInfo(currentPokemon)->isTeamLeader)
|
||||
{
|
||||
gLeaderPointer = currentPokemon;
|
||||
return currentPokemon;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
return leader;
|
||||
}
|
||||
|
||||
EntityInfo* GetLeaderInfo(void)
|
||||
{
|
||||
return GetEntInfo(GetLeader());
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
#include "global.h"
|
||||
#include "dungeon_range.h"
|
||||
#include "dungeon_leader.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "sprite.h"
|
||||
#include "structs/str_dungeon.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "structs/map.h"
|
||||
#include "structs/str_202ED28.h"
|
||||
|
||||
EWRAM_INIT Entity *gLeaderPointer = NULL;
|
||||
|
||||
bool8 IsPositionActuallyInSight(DungeonPos *pos1, DungeonPos *pos2)
|
||||
{
|
||||
@@ -234,3 +237,25 @@ bool8 sub_8083568(s32 inX, s32 inY, u8 index)
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
Entity* GetLeader(void)
|
||||
{
|
||||
Entity *leader = gLeaderPointer;
|
||||
if (leader == NULL) {
|
||||
s32 i;
|
||||
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
|
||||
Entity *currentPokemon = gDungeon->teamPokemon[i];
|
||||
if (EntityIsValid(currentPokemon) && GetEntInfo(currentPokemon)->isTeamLeader) {
|
||||
gLeaderPointer = currentPokemon;
|
||||
return currentPokemon;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
return leader;
|
||||
}
|
||||
|
||||
EntityInfo* GetLeaderInfo(void)
|
||||
{
|
||||
return GetEntInfo(GetLeader());
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
.include "src/dungeon_menu_recruitment.o"
|
||||
.include "src/dungeon_ai_items.o"
|
||||
.include "src/explosion.o"
|
||||
.include "src/dungeon_leader.o"
|
||||
.include "src/dungeon_range.o"
|
||||
.include "src/dungeon_random.o"
|
||||
.include "src/dungeon_music.o"
|
||||
.include "src/pokemon.o"
|
||||
|
||||
Reference in New Issue
Block a user