Use Vec3_Create3 less and avoid creating screenshots directory for webclient

This commit is contained in:
UnknownShadow200 2021-01-12 22:16:41 +11:00
parent d0f21a24b8
commit d496d87de6
3 changed files with 5 additions and 6 deletions

View File

@ -497,9 +497,7 @@ void Game_TakeScreenshot(void) {
#else #else
struct Stream stream; struct Stream stream;
#endif #endif
Game_ScreenshotRequested = false; Game_ScreenshotRequested = false;
if (!Utils_EnsureDirectory("screenshots")) return;
DateTime_CurrentLocal(&now); DateTime_CurrentLocal(&now);
String_InitArray(filename, fileBuffer); String_InitArray(filename, fileBuffer);
@ -520,6 +518,7 @@ void Game_TakeScreenshot(void) {
#elif CC_BUILD_MINFILES #elif CC_BUILD_MINFILES
/* no screenshots for these systems */ /* no screenshots for these systems */
#else #else
if (!Utils_EnsureDirectory("screenshots")) return;
String_InitArray(path, pathBuffer); String_InitArray(path, pathBuffer);
String_Format1(&path, "screenshots/%s", &filename); String_Format1(&path, "screenshots/%s", &filename);

View File

@ -775,7 +775,7 @@ static void ChatScreen_UpdateChatYOffsets(struct ChatScreen* s) {
} }
static void ChatScreen_OnInputTextChanged(void* elem) { static void ChatScreen_OnInputTextChanged(void* elem) {
ChatScreen_UpdateChatYOffsets(Gui_Chat); ChatScreen_UpdateChatYOffsets(&ChatScreen_Instance);
} }
static cc_string ChatScreen_GetChat(int i) { static cc_string ChatScreen_GetChat(int i) {
@ -1422,7 +1422,7 @@ static int InventoryScreen_KeyDown(void* screen, int key) {
Gui_Remove((struct Screen*)s); Gui_Remove((struct Screen*)s);
} else if (Elem_HandlesKeyDown(table, key)) { } else if (Elem_HandlesKeyDown(table, key)) {
} else { } else {
return Elem_HandlesKeyDown(&Gui_HUD->hotbar, key); return Elem_HandlesKeyDown(&HUDScreen_Instance.hotbar, key);
} }
return true; return true;
} }

View File

@ -283,12 +283,12 @@ float Respawn_HighestSolidY(struct AABB* bb) {
} }
Vec3 Respawn_FindSpawnPosition(float x, float z, Vec3 modelSize) { Vec3 Respawn_FindSpawnPosition(float x, float z, Vec3 modelSize) {
Vec3 spawn = Vec3_Create3(x, 0.0f, z); Vec3 spawn;
struct AABB bb; struct AABB bb;
float highestY; float highestY;
int y; int y;
spawn.Y = World.Height + ENTITY_ADJUSTMENT; Vec3_Set(spawn, x, World.Height + ENTITY_ADJUSTMENT, z);
AABB_Make(&bb, &spawn, &modelSize); AABB_Make(&bb, &spawn, &modelSize);
spawn.Y = 0.0f; spawn.Y = 0.0f;