Skip to content

Instantly share code, notes, and snippets.

View ranisalt's full-sized avatar

Ranieri Althoff ranisalt

View GitHub Profile
@ranisalt
ranisalt / dual-wielding.patch
Last active January 9, 2023 01:10
TFS 1.1 dual wielding
From 0daf4a3aa895283cf847d4333748ae69eec9b990 Mon Sep 17 00:00:00 2001
From: Ranieri Althoff <[email protected]>
Date: Thu, 9 Jul 2015 03:38:45 -0300
Subject: [PATCH] Enable dual weapon wielding, batteries included.
---
config.lua | 8 ++++++
src/configmanager.cpp | 3 +++
src/configmanager.h | 3 +++
src/luascript.cpp | 4 +++
@ranisalt
ranisalt / offline-training-optional.patch
Created May 11, 2015 05:36
Offline training optional
From 39f11e36d0fc2cf43a06108808d6bba35462dc8f Mon Sep 17 00:00:00 2001
From: Ranieri Althoff <[email protected]>
Date: Mon, 11 May 2015 01:36:26 -0300
Subject: [PATCH] Make offline training optional via config.lua
---
config.lua | 1 +
src/actions.cpp | 6 +++++-
src/configmanager.cpp | 1 +
src/configmanager.h | 1 +
// Configure pings accordingly
enum LED_PINS {
LED_RED = 0,
LED_GREEN = 1,
LED_BLUE = 2,
LED_PWM = 3
};
void writeColor(int color) {
GPIO_Pin red(LED_RED), green(LED_GREEN), blue(LED_BLUE), pwm(LED_PWM);
#include <chrono>
#include <iostream>
#include <mutex>
#include <thread>
#include <vector>
const unsigned int philosophers = 5;
const unsigned int iterations = 10;
std::mutex output;
@ranisalt
ranisalt / player-timestamp.patch
Created June 1, 2015 05:20
Player login/out timestamp
From b05c021f0023fb17ab502e0b7dc0baecedcb0c7f Mon Sep 17 00:00:00 2001
From: Ranieri Althoff <[email protected]>
Date: Mon, 1 Jun 2015 02:16:42 -0300
Subject: [PATCH] Add timestamp to player log in/out message
---
src/player.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/player.cpp b/src/player.cpp
@ranisalt
ranisalt / fix-offline-traning-rate.patch
Last active April 1, 2020 14:15
Fix offline traning rate
From 9063dccc1a8a730c6ffce6e78567e191e217be6e Mon Sep 17 00:00:00 2001
From: Ranieri Althoff <[email protected]>
Date: Mon, 1 Jun 2015 02:52:35 -0300
Subject: [PATCH] Fix offline traning ignoring skill/magic rate
---
src/player.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/player.cpp b/src/player.cpp
@ranisalt
ranisalt / iomap.cpp
Last active August 29, 2015 14:22
Buggy file
#include "lodepng/lodepng.h"
#include "iomap.h"
bool IOMap::exportPNG(const Map& map, std::string filename)
{
uint32_t size = static_cast<uint32_t>(map._height) * static_cast<uint32_t>(map._width);
std::vector<uint8_t> bytes(size * 4);
for (uint16_t x = 0; x < map._height; ++x) {
for (uint16_t y = 0; y < map._width; ++y) {
@ranisalt
ranisalt / rw.java
Created June 12, 2015 05:59
Problema dos Comedodes-Dadeiros
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Semaphore;
public class Main {
private Semaphore empty, full, readers, writers;
private List<Double> buffer;
private List<Thread> threads;
public class Reader implements Runnable {
@ranisalt
ranisalt / fft.cpp
Last active August 29, 2015 14:23
Broken code
#include <cstdint>
#include <iostream>
#include <iomanip>
#include "fft.h"
FFT::FFT(const std::string& filename)
: file(filename, std::ifstream::binary)
{
int32_t chunk_id;
file.read(reinterpret_cast<char*>(&chunk_id), 4);
@ranisalt
ranisalt / move-bug-report-to-lua.patch
Last active August 29, 2015 14:25
Move bug report to Lua
From d71d1eaa007b6f6d552eb7566572ce52f6ad1bc8 Mon Sep 17 00:00:00 2001
From: Ranieri Althoff <[email protected]>
Date: Wed, 15 Jul 2015 15:41:11 -0300
Subject: [PATCH] Move bug report to Lua
---
data/creaturescripts/creaturescripts.xml | 1 +
data/creaturescripts/scripts/report.lua | 26 +++++++++++++++++++++
src/creatureevent.cpp | 40 ++++++++++++++++++++++++++++++++
src/creatureevent.h | 3 +++