Skip to content

Commit 1c7d668

Browse files
Merge pull request #65 from liam-middlebrook/event-death
Update EVENT_TYPE_DEAD broadcast spec
2 parents b967b28 + c3f57b9 commit 1c7d668

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

libnethack/src/topten.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ toptenlist_insert(struct toptenentry *ttlist, struct toptenentry *newtt)
507507
static void
508508
emit_dead_event(struct toptenentry *tt)
509509
{
510-
char *argv[9];
510+
char *argv[10];
511511
argv[0] = tt->name;
512512
argv[1] = tt->plrole;
513513
argv[2] = tt->plrace;
@@ -516,8 +516,9 @@ emit_dead_event(struct toptenentry *tt)
516516
asprintf(&argv[5], "%d", tt->deathlev);
517517
asprintf(&argv[6], "%d", tt->hp);
518518
asprintf(&argv[7], "%d", tt->maxhp);
519-
argv[8] = tt->death;
520-
event_trigger_async(EVENT_TYPE_DEAD, 9, argv);
519+
argv[8] = tt->points;
520+
argv[9] = tt->death;
521+
event_trigger_async(EVENT_TYPE_DEAD, 10, argv);
521522
free(argv[5]);
522523
free(argv[6]);
523524
free(argv[7]);

scripts/nethack_events/bingehack-tweeter/bingehack-twitter.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
require 'net/ldap'
88
require 'yaml'
99

10-
if ARGV.length != 9
11-
$stderr.puts "Usage: #{$0} name role race gender align deathlev hp maxhp death"
10+
if ARGV.length != 10
11+
$stderr.puts "Usage: #{$0} name role race gender align deathlev hp maxhp points death"
1212
exit(false)
1313
end
1414

15-
name, role, race, gender, align, deathlev, hp, maxhp, death = *ARGV
15+
name, role, race, gender, align, deathlev, hp, maxhp, points, death = *ARGV
1616

1717
$config = YAML.load_file('twitter-config.yml')
1818

@@ -62,4 +62,4 @@ def get_twitter_username(name)
6262

6363
client = Twitter::Client.new
6464

65-
client.update("#{name}-#{role}-#{race}-#{gender}-#{align} #{death} on level #{deathlev} (HP: #{hp} [#{maxhp}])"[0,140])
65+
client.update("#{name}-#{role}-#{race}-#{gender}-#{align} #{death} on level #{deathlev} (HP: #{hp} [#{maxhp}]) Points: #{points}"[0,140])

0 commit comments

Comments
 (0)