Fix last commit

This commit is contained in:
UnknownShadow200 2024-04-25 18:49:24 +10:00
parent c7fd3a05f9
commit 35ad6372ff
5 changed files with 14 additions and 9 deletions

View File

@ -952,10 +952,18 @@ cc_bool LocalPlayer_CheckCanZoom(struct LocalPlayer* p) {
return false;
}
void LocalPlayer_MoveToSpawn(struct LocalPlayer* p, struct LocationUpdate* update) {
p->Base.VTABLE->SetLocation(&p->Base, update);
void LocalPlayers_MoveToSpawn(struct LocationUpdate* update) {
struct LocalPlayer* p;
int i;
for (i = 0; i < Game_NumLocalPlayers; i++)
{
p = &LocalPlayer_Instances[i];
p->Base.VTABLE->SetLocation(&p->Base, update);
}
/* TODO: This needs to be before new map... */
Camera.CurrentPos = Camera.Active->GetPosition(p, 0.0f);
Camera.CurrentPos = Camera.Active->GetPosition(Entities.CurPlayer, 0.0f);
}
void LocalPlayer_CalcDefaultSpawn(struct LocalPlayer* p, struct LocationUpdate* update) {

View File

@ -253,7 +253,7 @@ void LocalPlayer_SetInterpPosition(struct LocalPlayer* p, float t);
void LocalPlayer_ResetJumpVelocity(struct LocalPlayer* p);
cc_bool LocalPlayer_CheckCanZoom(struct LocalPlayer* p);
/* Moves local player back to spawn point. */
void LocalPlayer_MoveToSpawn(struct LocalPlayer* p, struct LocationUpdate* update);
void LocalPlayers_MoveToSpawn(struct LocationUpdate* update);
void LocalPlayer_CalcDefaultSpawn(struct LocalPlayer* p, struct LocationUpdate* update);
cc_bool LocalPlayer_HandleRespawn(struct LocalPlayer* p);

View File

@ -87,7 +87,7 @@ cc_result Map_LoadFrom(const cc_string* path) {
World_SetNewMap(World.Blocks, World.Width, World.Height, World.Length);
if (!spawn_point) LocalPlayer_CalcDefaultSpawn(Entities.CurPlayer, &update);
LocalPlayer_MoveToSpawn(&LocalPlayer_Instances[0], &update);
LocalPlayers_MoveToSpawn(&update);
relPath = *path;
Utils_UNSAFE_GetFilename(&relPath);

View File

@ -284,9 +284,6 @@ cc_bool Game_ValidateBitmapPow2(const cc_string* file, struct Bitmap* bmp) {
void Game_UpdateDimensions(void) {
Game.Width = max(Window_Main.Width, 1);
Game.Height = max(Window_Main.Height, 1);
Gfx.ViewportWidth = Game.Width;
Gfx.ViewportHeight = Game.Height;
}
static void Game_OnResize(void* obj) {

View File

@ -2004,7 +2004,7 @@ static void GeneratingScreen_EndGeneration(void) {
World.Seed = Gen_Seed;
LocalPlayer_CalcDefaultSpawn(Entities.CurPlayer, &update);
LocalPlayer_MoveToSpawn(&LocalPlayer_Instances[0], &update);
LocalPlayers_MoveToSpawn(&update);
}
static void GeneratingScreen_Update(void* screen, double delta) {