Compare commits
No commits in common. "main" and "0.5.11" have entirely different histories.
4 changed files with 5 additions and 19 deletions
|
@ -4,7 +4,7 @@ This is an elemental combination game written in C, with optional multi-player s
|
||||||
## Clients
|
## Clients
|
||||||
- [PenguinMod client](https://studio.penguinmod.com/?fps=200&clones=Infinity&offscreen&size=850x480#7218964246) for playing the game online with a fancy interface
|
- [PenguinMod client](https://studio.penguinmod.com/?fps=200&clones=Infinity&offscreen&size=850x480#7218964246) for playing the game online with a fancy interface
|
||||||
- [Discord client](https://discord.gg/DKZTWyWH3B) for playing the game publicly with other Discord members
|
- [Discord client](https://discord.gg/DKZTWyWH3B) for playing the game publicly with other Discord members
|
||||||
- [Web client](https://elem.dervland.net/index.html) for a demo of the multiplayer version
|
- [Web client](https://elem.dervland.net/) for a demo of the multiplayer version
|
||||||
- [Original client](https://git.dervland.net/elemental/elemental-on-terminal/releases) for developers, administrators, and command line fans
|
- [Original client](https://git.dervland.net/elemental/elemental-on-terminal/releases) for developers, administrators, and command line fans
|
||||||
|
|
||||||
## Single-player
|
## Single-player
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include <time.h>
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -143,13 +142,8 @@ int success_handler(const void *key, size_t size, uintptr_t val, void *usr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char *handle_pages(char *command, char *invs) {
|
char *handle_pages(char *command, char *invs) {
|
||||||
char *data;
|
|
||||||
char *data2;
|
|
||||||
if (strncmp(command, invs, strlen(invs)) == 0) {
|
if (strncmp(command, invs, strlen(invs)) == 0) {
|
||||||
data = &command[strlen(invs)];
|
return &command[strlen(invs)];
|
||||||
data2 = malloc(strlen(data) + 1);
|
|
||||||
memcpy(data2,data,strlen(data) + 1);
|
|
||||||
return data2;
|
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -183,8 +177,6 @@ int suggest_command(char *command, char *command_re, hashmap *polls, hashmap *co
|
||||||
char *val = calloc(MAX_BUF_LENGTH, sizeof(char));
|
char *val = calloc(MAX_BUF_LENGTH, sizeof(char));
|
||||||
sprintf(val, "%s;%s", page, command_re);
|
sprintf(val, "%s;%s", page, command_re);
|
||||||
|
|
||||||
srand(time(NULL));
|
|
||||||
|
|
||||||
char *key = calloc(MAX_BUF_LENGTH, sizeof(char));
|
char *key = calloc(MAX_BUF_LENGTH, sizeof(char));
|
||||||
sprintf(key, "%s_%i", name, (int)rand());
|
sprintf(key, "%s_%i", name, (int)rand());
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,7 @@ int entry_handler(const void *key, size_t size, uintptr_t val, void *usr) {
|
||||||
}
|
}
|
||||||
} else if (usr2->mode == 1) {
|
} else if (usr2->mode == 1) {
|
||||||
fwrite(key2, sizeof(char), strlen(key2), usr2->fptr);
|
fwrite(key2, sizeof(char), strlen(key2), usr2->fptr);
|
||||||
if (key2[strlen(key2) - 1] != '\n') {
|
fwrite("\n", sizeof(char), 1, usr2->fptr);
|
||||||
fwrite("\n", sizeof(char), 1, usr2->fptr);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
fwrite(key2, sizeof(char), strlen(key2), usr2->fptr);
|
fwrite(key2, sizeof(char), strlen(key2), usr2->fptr);
|
||||||
fwrite(";", sizeof(char), 1, usr2->fptr);
|
fwrite(";", sizeof(char), 1, usr2->fptr);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "loader.h"
|
#include "loader.h"
|
||||||
#include "map.h"
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -88,11 +87,8 @@ int main(int argc, char *argv[]) {
|
||||||
was_combination = 0;
|
was_combination = 0;
|
||||||
if (help_command(command))
|
if (help_command(command))
|
||||||
continue;
|
continue;
|
||||||
if (polls_command(command, polls, elements)) {
|
if (polls_command(command, polls, elements))
|
||||||
hashmap_free(polls);
|
continue;
|
||||||
polls = hashmap_create();
|
|
||||||
init_tables(elements, inv, polls, elements_rev, 0);
|
|
||||||
}
|
|
||||||
if (slash_command(command, inv))
|
if (slash_command(command, inv))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue