case 'M':
KEY( "Materials", fread_flag(fp));
case 'M':
KEY( "Materials", pArea->materials, fread_flag(fp));
break;
#AREADATA
Name Limbo~
Builders None~
VNUMs 1 500
Credits [ IMM ] Immortal Realms~
Security 0
Materials ABDE
End
/*material types*/
#define MAT_UNKNOWN 0
#define MAT_GLASS 1
#define MAT_BLOOD 2
#define MAT_FOOD 3
#define MAT_LIQUID 4
#define MAT_MAGICAL 5
#define MAT_PAPER 6
#define MAT_PLANTLIFE 7
#define MAT_WOOD 8
#define MAT_SILK 9
#define MAT_LINEN 10
#define MAT_CLOTH 11
#define MAT_DRAGONSKIN 12
#define MAT_FEATHER 13
#define MAT_FUR 14
#define MAT_HIDE 15
#define MAT_LEATHER 16
#define MAT_STONE 17
#define MAT_BONE 18
#define MAT_BRAE 19
#define MAT_CERAMIC 20
#define MAT_PYNIUM 21
#define MAT_BRAUN 22
#define MAT_CUPRIM 23
#define MAT_MALEDRITE 24
#define MAT_GOLD 25
#define MAT_MICITE 26
#define MAT_HEMITE 27
#define MAT_IRIUM 28
#define MAT_SILVER 29
#define MAT_DOLOMEL 30
#define MAT_SHELL 31
#define MAT_SEPOL 32
#define MAT_BISCE 33
#define MAT_YAHALM 34
#define MAT_VERDIL 35
#define MAT_GODSICE 36
#define MAT_IBHA 37
#define MAT_AQUINE 38
#define MAT_SHOHAM 39
#define MAT_NACERIL 40
#define MAT_ALSTINE 41
#define MAT_ROSEALE 42
#define MAT_CERUL 43
#define MAT_UNKNOWN (A)
#define MAT_GLASS (B)
#define MAT_UNKNOWN (A)
#define MAT_GLASS (B)
pcdata->visitedroom = (char *)malloc(8192 * sizeof(char)); //0 to 8192*8 possible value stored
//8 is for one byte (as sizeofchar is one byte)
bool_t is_room_visited(CHAR_DATA *ch, ROOM_INDEX_DATA *pRoomIndex) {
return ch->pcdata->visitedroom[pRoomIndex->vnum / 8] & (1 << (pRoomIndex->vnum % 8)) ? TRUE : FALSE;
}
void set_room_visited(CHAR_DATA *ch, ROOM_INDEX_DATA *pRoomIndex) {
ch->pcdata->visitedroom[pRoomIndex->vnum / 8] |= (1 << (pRoomIndex->vnum % 8));
}
So in all my recent work on a crafting system I've likely driven my code-buddy crazy, so here's one last thing I can't figure out.
The support code for mining requires that each area have a variety of materials set, so players who use their mining skill in the appropriate places have a shot at finding a raw material.
I've been working on this for a while now without much of a break, and it's driving me crazy that this last little bit won't function properly - I know I'm doing something very stupid and incorrect, but I really don't understand flag handling well enough to see it. So, any advice would be appreciated.
tl;dr: I'm stupid, please do my homework for me. Or at least tell me where I'm being stupid.
The following is what is currently occurring:
aedit 0
[Melopene's Library - 400 | - Limbo]
Name: [ 0] Limbo
File: limbo.are
Vnums: [1-500]
Age: [1]
Players: [1]
Security: [0]
Builders: [None]
Credits : [[ IMM ] Immortal Realms]
Materials: [unknown]
Flags: [none]
[Melopene's Library - 400 | - Limbo]
material hemite
[Melopene's Library - 400 | - Limbo]
Name: [ 0] Limbo
File: limbo.are
Vnums: [1-500]
Age: [1]
Players: [1]
Security: [0]
Builders: [None]
Credits : [[ IMM ] Immortal Realms]
Materials: [glass blood food magical paper plantlife wood silk linen cloth dragonskin feather fur hide leather stone bone brae ceramic pynium braun cuprim maledrite gold micite hemite irium silver dolomel shell bisce yahalm verdil ibha aquine shoham naceril alstine roseale cerul]
Flags: [changed]
[Melopene's Library - 400 | - Limbo]
asave changed
Saved zones:
Limbo - 'limbo.are'
[Melopene's Library - 400 | - Limbo]
copyover
You find yourself feeling a little off, as if something is wrong.
You pause for a moment to reflect on what it might be…
You shake your head, returning your attention to reality.
[ Melopene's Library ] [ Room 400 ]
A lengthy hall, lined with chalkboards and computer terminals, expands
along a north-south axis. The chalkboards are covered with scribbled
notations and ideas, as well as a few bits of pseudo-code, and the computer
terminals display various outputs of regression and factor analysis models.
Along the length of the hall, the grayed marble floors are largely empty,
save for a heavy mahogany desk and accompanying chair at the front of the
room. The desk is littered with papers on various topics from volunteerism
and work motivation to implementation of new governmental forms.
[Exits: none]
TICK!
[Melopene's Library - 400 | - Limbo]
aedit 0
[Melopene's Library - 400 | - Limbo]
Name: [ 0] Limbo
File: limbo.are
Vnums: [1-500]
Age: [1]
Players: [1]
Security: [0]
Builders: [None]
Credits : [[ IMM ] Immortal Realms]
Materials: [unknown]
Flags: [none]
And the following is the related code.
From olc_act.c:
also, olc_act.c:
from olc_save.c:
A glance at my material table structure:
Aaaand, for fun, load_area_new, from db.c: