Skip to content

Commit

Permalink
Fix long farlook loop, add traps to situation patch
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Aug 10, 2011
1 parent 9d25186 commit b45e593
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
17 changes: 14 additions & 3 deletions patches/situation.patch
@@ -1,6 +1,6 @@
--- nethack-3.4.3-orig/src/allmain.c 2003-12-07 15:39:13.000000000 -0800 --- nethack-3.4.3-orig/src/allmain.c 2003-12-07 15:39:13.000000000 -0800
+++ nethack-3.4.3/src/allmain.c 2011-04-20 13:11:53.000000000 -0700 +++ nethack-3.4.3/src/allmain.c 2011-08-09 21:15:13.000000000 -0700
@@ -477,6 +477,239 @@ @@ -477,6 +477,250 @@
} }


void void
Expand Down Expand Up @@ -38,6 +38,11 @@
+ } else if (!strncmp(lbuf, "skill ", 6)) { + } else if (!strncmp(lbuf, "skill ", 6)) {
+ sscanf(lbuf, "skill %d %d", &a[0], &a[1]); + sscanf(lbuf, "skill %d %d", &a[0], &a[1]);
+ P_SKILL(a[0]) = a[1]; + P_SKILL(a[0]) = a[1];
+ } else if (!strncmp(lbuf, "skillx ", 7)) {
+ sscanf(lbuf, "skillx %d %d %d %d", &a[0], &a[1], &a[2], &a[3]);
+ P_SKILL(a[0]) = a[1];
+ P_MAX_SKILL(a[0]) = a[2];
+ P_ADVANCE(a[0]) = a[3];
+ } else if (!strncmp(lbuf, "blind ", 6)) { + } else if (!strncmp(lbuf, "blind ", 6)) {
+ sscanf(lbuf, "blind %d", &i); + sscanf(lbuf, "blind %d", &i);
+ make_blinded(i, FALSE); + make_blinded(i, FALSE);
Expand Down Expand Up @@ -126,6 +131,9 @@
+ } else if (!strncmp(lbuf, "at ", 3)) { + } else if (!strncmp(lbuf, "at ", 3)) {
+ sscanf(lbuf, "at %d %d", &a[0], &a[1]); + sscanf(lbuf, "at %d %d", &a[0], &a[1]);
+ u.ux = a[0]; u.uy = a[1]; + u.ux = a[0]; u.uy = a[1];
+ } else if (!strncmp(lbuf, "mkroom ", 7)) {
+ sscanf(lbuf, "mkroom %d", &i);
+ mkroom(i);
+ } else if (!strncmp(lbuf, "room ", 5)) { + } else if (!strncmp(lbuf, "room ", 5)) {
+ sscanf(lbuf, "room %d %d %d %d %d %d", + sscanf(lbuf, "room %d %d %d %d %d %d",
+ &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]); + &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]);
Expand All @@ -147,6 +155,9 @@
+ } else if (!strncmp(lbuf, "fountain ", 9)) { + } else if (!strncmp(lbuf, "fountain ", 9)) {
+ sscanf(lbuf, "fountain %d %d", &a[0], &a[1]); + sscanf(lbuf, "fountain %d %d", &a[0], &a[1]);
+ levl[a[0]][a[1]].typ = FOUNTAIN; + levl[a[0]][a[1]].typ = FOUNTAIN;
+ } else if (!strncmp(lbuf, "trap ", 5)) {
+ sscanf(lbuf, "trap %d %d %d", &a[0], &a[1], &a[2]);
+ maketrap(a[0], a[1], a[2]);
+ } else if (!strncmp(lbuf, "obj ", 4)) { + } else if (!strncmp(lbuf, "obj ", 4)) {
+ lbuf[strlen(lbuf)-1] = 0; + lbuf[strlen(lbuf)-1] = 0;
+ sscanf(lbuf, "obj %d %d %n", &a[0], &a[1], &i); + sscanf(lbuf, "obj %d %d %n", &a[0], &a[1], &i);
Expand Down Expand Up @@ -240,7 +251,7 @@
newgame() newgame()
{ {
int i; int i;
@@ -514,6 +747,7 @@ @@ -514,6 +758,7 @@


mklev(); mklev();
u_on_upstairs(); u_on_upstairs();
Expand Down
1 change: 1 addition & 0 deletions src/Actions/FarLook.cpp
Expand Up @@ -35,6 +35,7 @@ const Command& FarLook::command() {
string moves = World::cursorMoves(Saiph::position(), iter->where); string moves = World::cursorMoves(Saiph::position(), iter->where);
cmdbuf.insert(cmdbuf.end(), moves.begin(), moves.end()); cmdbuf.insert(cmdbuf.end(), moves.begin(), moves.end());
cmdbuf.push_back('.'); cmdbuf.push_back('.');
cmdbuf.push_back(' ');
} }
_command = Command(cmdbuf, PRIORITY_LOOK); _command = Command(cmdbuf, PRIORITY_LOOK);
return _command; return _command;
Expand Down

0 comments on commit b45e593

Please sign in to comment.