mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-23 09:34:35 -05:00
Remove unused index argument from Utils_IsUrlPrefix
This commit is contained in:
parent
ec39ee90a7
commit
5c0cd0d871
7 changed files with 12 additions and 11 deletions
|
@ -154,7 +154,7 @@ void Entity_SetModel(struct Entity* e, const String* model) {
|
|||
Entity_UpdateModelBounds(e);
|
||||
|
||||
skin = String_FromRawArray(e->SkinNameRaw);
|
||||
if (Utils_IsUrlPrefix(&skin, 0)) { e->MobTextureId = e->TextureId; }
|
||||
if (Utils_IsUrlPrefix(&skin)) e->MobTextureId = e->TextureId;
|
||||
}
|
||||
|
||||
void Entity_UpdateModelBounds(struct Entity* e) {
|
||||
|
@ -349,7 +349,7 @@ static void Entity_CopySkin(struct Entity* dst, struct Entity* src) {
|
|||
/* Custom mob textures */
|
||||
dst->MobTextureId = GFX_NULL;
|
||||
skin = String_FromRawArray(dst->SkinNameRaw);
|
||||
if (Utils_IsUrlPrefix(&skin, 0)) dst->MobTextureId = dst->TextureId;
|
||||
if (Utils_IsUrlPrefix(&skin)) dst->MobTextureId = dst->TextureId;
|
||||
}
|
||||
|
||||
/* Resets skin data for the given entity */
|
||||
|
|
|
@ -895,7 +895,7 @@ void Http_AsyncGetSkin(const String* skinName) {
|
|||
String url; char urlBuffer[STRING_SIZE];
|
||||
String_InitArray(url, urlBuffer);
|
||||
|
||||
if (Utils_IsUrlPrefix(skinName, 0)) {
|
||||
if (Utils_IsUrlPrefix(skinName)) {
|
||||
String_Copy(&url, skinName);
|
||||
} else {
|
||||
String_AppendConst(&url, SKIN_SERVER);
|
||||
|
|
|
@ -31,8 +31,8 @@ void Inventory_SetHotbarIndex(int index) {
|
|||
void Inventory_SetSelectedBlock(BlockID block) {
|
||||
int i;
|
||||
if (!Inventory_CheckChangeSelected()) return;
|
||||
/* Swap with the current, if the new block is already in the hotbar */
|
||||
|
||||
|
||||
/* Swap with currently selected block if given block is already in the hotbar */
|
||||
for (i = 0; i < INVENTORY_BLOCKS_PER_HOTBAR; i++) {
|
||||
if (Inventory_Get(i) != block) continue;
|
||||
Inventory_Set(i, Inventory_SelectedBlock);
|
||||
|
|
|
@ -1193,7 +1193,7 @@ static void CPE_SetTextColor(uint8_t* data) {
|
|||
static void CPE_SetMapEnvUrl(uint8_t* data) {
|
||||
String url = Protocol_UNSAFE_GetString(data);
|
||||
|
||||
if (!url.length || Utils_IsUrlPrefix(&url, 0)) {
|
||||
if (!url.length || Utils_IsUrlPrefix(&url)) {
|
||||
Server_RetrieveTexturePack(&url);
|
||||
}
|
||||
Platform_Log1("Tex url: %s", &url);
|
||||
|
|
|
@ -1022,7 +1022,7 @@ static bool ChatScreen_MouseDown(void* screen, int x, int y, MouseButton btn) {
|
|||
TextGroupWidget_GetSelected(&s->chat, &text, x, y);
|
||||
if (!text.length) return false;
|
||||
|
||||
if (Utils_IsUrlPrefix(&text, 0)) {
|
||||
if (Utils_IsUrlPrefix(&text)) {
|
||||
Gui_ShowOverlay(UrlWarningOverlay_MakeInstance(&text));
|
||||
} else if (Gui_ClickableChat) {
|
||||
InputWidget_AppendString(&s->input.base, &text);
|
||||
|
|
|
@ -19,12 +19,12 @@ int Utils_ParseEnum(const String* text, int defValue, const char** names, int na
|
|||
return defValue;
|
||||
}
|
||||
|
||||
bool Utils_IsUrlPrefix(const String* value, int index) {
|
||||
bool Utils_IsUrlPrefix(const String* value) {
|
||||
static const String http = String_FromConst("http://");
|
||||
static const String https = String_FromConst("https://");
|
||||
|
||||
return String_IndexOfString(value, &http) == index
|
||||
|| String_IndexOfString(value, &https) == index;
|
||||
return String_IndexOfString(value, &http) == 0
|
||||
|| String_IndexOfString(value, &https) == 0;
|
||||
}
|
||||
|
||||
bool Utils_EnsureDirectory(const char* dirName) {
|
||||
|
|
|
@ -28,7 +28,8 @@ struct DateTime {
|
|||
#define MILLIS_PER_DAY (1000 * 60 * 60 * 24)
|
||||
|
||||
CC_NOINLINE int Utils_ParseEnum(const String* text, int defValue, const char** names, int namesCount);
|
||||
bool Utils_IsUrlPrefix(const String* value, int index);
|
||||
/* Returns whether value starts with http:// or https:// */
|
||||
bool Utils_IsUrlPrefix(const String* value);
|
||||
|
||||
/* Creates the directory if it doesn't exist. (logs failure using Logger_Warn2) */
|
||||
bool Utils_EnsureDirectory(const char* dirName);
|
||||
|
|
Loading…
Add table
Reference in a new issue