diff --git a/extensions/updater/Makefile b/extensions/updater/Makefile index 96bbb6a3..b3fcffcb 100644 --- a/extensions/updater/Makefile +++ b/extensions/updater/Makefile @@ -76,7 +76,7 @@ ifeq "$(USEMETA)" "true" CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4 else INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn \ - -I$(SMSDK)/public/extensions + -I$(SMSDK)/public/extensions -I$(MMSOURCE17)/core/sourcehook endif LINK += -m32 -lm -ldl diff --git a/extensions/updater/Updater.h b/extensions/updater/Updater.h index a8c3c6c7..247b8231 100644 --- a/extensions/updater/Updater.h +++ b/extensions/updater/Updater.h @@ -37,6 +37,8 @@ #include #include "MemoryDownloader.h" +using namespace SourceHook; + struct UpdatePart { UpdatePart* next; diff --git a/extensions/updater/extension.cpp b/extensions/updater/extension.cpp index 7e9b8fe6..e7dcc1f1 100644 --- a/extensions/updater/extension.cpp +++ b/extensions/updater/extension.cpp @@ -159,12 +159,18 @@ static void PumpUpdate(void *data) AddUpdateError("Could not open %s for writing", path); return; } - fwrite(part->data, 1, part->length, fp); + if (fwrite(part->data, 1, part->length, fp) != part->length) + { + AddUpdateError("Could not write file %s", path); + } + else + { + smutils->LogMessage(myself, + "Successfully updated gamedata file \"%s\"", + part->file); + new_files = true; + } fclose(fp); - smutils->LogMessage(myself, - "Successfully updated gamedata file \"%s\"", - part->file); - new_files = true; } skip_create: temp = part->next;