History

convert monstdata array to ndb file, make monsters by name. make some types more consistent

mischief committed 11 years ago

Commit 4bbc7bc1 parent c99276c11 files · +312 −134Browse files

Showing the changes to hack9.c (1 of 11 files). Show all

Unified · Split

hack9.c+7−1
@@ -107,6 +107,7 @@ usage(void) · 106 unmodified lines
107107 void
108108 threadmain(int argc, char *argv[])
109109 {
110+ char buf[256];
110111 /* of viewport, in size of tiles */
111112 Tile *t;
112113 Level *level;
@@ -129,6 +130,11 @@ threadmain(int argc, char *argv[]) · 16 unmodified lines
129130
130131 uiinit(argv0);
131132
133+ snprint(buf, sizeof(buf), "%s/lib/hack9/%s", home, "monster.ndb");
134+ if(monstdbopen(buf) < 0)
135+ if(monstdbopen("monster.ndb") < 0)
136+ sysfatal("monstdbopen: %r");
137+
132138 /* initial level */
133139 if(debug > 0){
134140 if((level = genlevel(11, 11, 0)) == nil)
@@ -139,7 +145,7 @@ threadmain(int argc, char *argv[]) · 4 unmodified lines
139145 }
140146
141147 /* the player */
142− player = monst(TWIZARD);
148+ player = mbyname("wizard");
143149 if(player == nil)
144150 sysfatal("monst: %r");
145151

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t