Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
AtomicSponge committed Nov 19, 2024
1 parent f5d9542 commit 911b983
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions include/silvergun/mgr/messages.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ class messages final : private manager<messages> {
const char ch = al_fgetc(&file);
if (ch == '\0') break; // End loop if null terminated.
if (ch == EOF) {
throw engine_exception("Bad message file format!", "Messages", 2);
//throw engine_exception("Bad message file format!", "Messages", 2);
break;
}
sys += ch;
}
Expand Down Expand Up @@ -222,27 +223,21 @@ class messages final : private manager<messages> {
static bool load_script(const std::string& fname) {
// Open data file - read binary mode.
ALLEGRO_FILE* file;
std::cout << "file not yet opened\n";
file = al_fopen(fname.c_str(), "rb");
std::cout << "file opened\n";
// File not found, error.
if (!file) {
al_fclose(file);
return false;
}

// Loop through the entire data file loading into the queue.
while (true) {
if (al_feof(file)) break; // End loop if eof.

while (!al_feof(file)) {
int64_t timer = -1;
std::string sys, to, from, cmd, args;

try {
// Read the message from file.
std::cout << "before read\n";
read(*file, timer, sys, to, from, cmd, args);
std::cout << "after read\n";
// Add the current time to the timer value.
if (timer != -1) timer += engine_time::check();
// Add message to queue. Ignore incomplete messages. Sort while adding.
Expand Down

0 comments on commit 911b983

Please sign in to comment.