23 Oct, 2006, Pedlar wrote in the 1st comment:
Votes: 0
Ok, so let me describe my code before i introduce you to the problem. Ok, i have a very extensive OLC with a prompt driven system.
So far none of this code has ever been seen by other then me, and Davion, But yall get to see a lil peice of my fine work here today.

ok, I have many instances of this, but there all pretty much the same, so ifya have any idea for this one, it will help me with the rest of them.

polc.c: In function ‘BOOL edit_room(CHAR_DATA*, char*)’:
polc.c:2863: error: invalid lvalue in assignment


polc.c:
the if statement is what gives the error:
if((wpRoom=GetRoomInArea(GetNumber(argument,0),ch->zone))==NULL)
{
send_to_char("No such room in this area.\r\n",ch);
return TRUE;
}

the GetRoomInArea:
ROOM_INDEX_DATA *GetRoomInArea(int vnum, AREA_DATA *pArea)
{
ROOM_INDEX_DATA *p;

for (p = room_index_hash[vnum%MAX_KEY_HASH];p;p=p->next)
{
if (vnum == p->vnum)
return p;
}
return NULL;
}


polc.h: My Macro for wpRoom:
#define wpRoom	 ((ROOM_INDEX_DATA *) ch->pcdata->pWriting->pData)


merc.h: to showya the WRITING_DATA structure (contains the pData pointer)
PSTR = char*
LONG = int
PVOID = void*
BOOL = bool (duh!)
struct writing_data
{
WRITING_DATA *next;
WRITING_FUN *function;
ROOM_INDEX_DATA *oldroom;
PSTR prompt;
LONG oldpos;
LONG iData;
PVOID pData;
LONG sData;
BOOL bFreeData;
BOOL valid;
};


now it use to work and compile nicely under Debian, but now im trieing to compile it under Ubuntu, and its jus not working right so anyhelp would be greatly appreciated, me and Davion have been trying to work on this for a little while now, and keep coming up blank
23 Oct, 2006, kiasyn wrote in the 2nd comment:
Votes: 0
problem was in the macro:
#define wpRoom     ((ROOM_INDEX_DATA *) ch->pcdata->pWriting->pData)


solution was to add another macro:
#define wpRoomEdit     (ch->pcdata->pWriting->pData)


to be used for assigning, ie:
if((wpRoom=GetRoomInArea(GetNumber(argument,0),ch->zone))==NULL)
0.0/2