Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
P
proto1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alynna Trypnotk
proto1
Commits
9c21c5f4
Commit
9c21c5f4
authored
Sep 10, 2003
by
alynna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Array and MPI fixes backported from Proto2. Version updated.
parent
146d8fea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
29 deletions
+52
-29
array.c
protomuck/src/array.c
+11
-4
version.h
protomuck/src/inc/version.h
+2
-2
msgparse.c
protomuck/src/msgparse.c
+35
-21
p_array.c
protomuck/src/p_array.c
+4
-2
No files found.
protomuck/src/array.c
View file @
9c21c5f4
...
...
@@ -69,6 +69,7 @@ array_tree_compare(array_iter *a, array_iter *b, int case_sens, int objname)
return
-
1
;
}
}
else
if
(
a
->
type
==
PROG_FLOAT
&&
b
->
type
==
PROG_INTEGER
)
{
if
(
a
->
data
.
fnumber
==
b
->
data
.
fnumber
)
{
return
0
;
}
else
if
(
fabs
((
a
->
data
.
fnumber
-
b
->
data
.
number
)
/
a
->
data
.
fnumber
)
<
DBL_EPSILON
)
{
return
0
;
...
...
@@ -121,6 +122,7 @@ array_tree_compare(array_iter *a, array_iter *b, int case_sens, int objname)
return
0
;
}
if
(
a
->
type
==
PROG_FLOAT
)
{
if
(
a
->
data
.
fnumber
==
b
->
data
.
fnumber
)
{
return
0
;
}
else
if
(
fabs
((
a
->
data
.
fnumber
-
b
->
data
.
fnumber
)
/
a
->
data
.
fnumber
)
<
DBL_EPSILON
)
{
return
0
;
...
...
@@ -145,10 +147,15 @@ array_tree_compare(array_iter *a, array_iter *b, int case_sens, int objname)
/* in a perfect world, we'd compare the array elements recursively. */
return
(
a
->
data
.
array
-
b
->
data
.
array
);
}
else
if
(
a
->
type
==
PROG_LOCK
)
{
/* Sort locks by memory address. */
/* This is a bug, really. */
/* in a perfect world, we'd compare the locks by element. */
return
(
a
->
data
.
lock
-
b
->
data
.
lock
);
char
*
la
;
char
*
lb
;
int
retval
=
0
;
la
=
(
char
*
)
unparse_boolexp
((
dbref
)
1
,
a
->
data
.
lock
,
0
);
la
=
string_dup
(
la
);
lb
=
(
char
*
)
unparse_boolexp
((
dbref
)
1
,
b
->
data
.
lock
,
0
);
retval
=
strcmp
(
la
,
lb
);
free
(
la
);
return
retval
;
}
else
if
(
a
->
type
==
PROG_ADD
)
{
int
result
=
(
a
->
data
.
addr
->
progref
-
b
->
data
.
addr
->
progref
);
...
...
protomuck/src/inc/version.h
View file @
9c21c5f4
#define PROTOBASE "1.8
1b3
"
#define PROTOBASE "1.8
5
"
#define PROTOVER "Proto" PROTOBASE
#define NEONVER "Neon2.17"
#define VERSION "Muck2.2fb6.00
rc9
"
#define VERSION "Muck2.2fb6.00"
extern
const
char
*
infotext
[];
protomuck/src/msgparse.c
View file @
9c21c5f4
...
...
@@ -828,22 +828,32 @@ mesg_parse(int descr, dbref player, dbref what, dbref perms, const char *inbuf,
int
literalflag
=
0
;
mesg_rec_cnt
++
;
if
(
mesg_rec_cnt
>
26
)
{
mesg_rec_cnt
--
;
strncpy
(
outbuf
,
inbuf
,
maxchars
);
outbuf
[
maxchars
-
1
]
=
'\0'
;
return
outbuf
;
}
if
(
Typeof
(
player
)
==
TYPE_GARBAGE
)
{
return
NULL
;
}
if
(
Typeof
(
what
)
==
TYPE_GARBAGE
)
{
if
(
player
<
1
)
notify_descriptor
(
descr
,
"MPI Error: Garbage trigger."
);
else
notify_nolisten
(
player
,
"MPI Error: Garbage trigger."
,
1
);
return
NULL
;
}
if
(
mesg_rec_cnt
>
26
)
{
char
*
zptr
=
get_mvar
(
"how"
);
snprintf
(
dbuf
,
sizeof
(
dbuf
),
"%s Recursion limit exceeded."
,
zptr
);
if
(
player
<
1
)
notify_descriptor
(
descr
,
dbuf
);
else
notify_nolisten
(
player
,
dbuf
,
1
);
mesg_rec_cnt
--
;
outbuf
[
0
]
=
'\0'
;
return
NULL
;
}
if
(
Typeof
(
player
)
==
TYPE_GARBAGE
)
{
mesg_rec_cnt
--
;
outbuf
[
0
]
=
'\0'
;
return
NULL
;
}
if
(
Typeof
(
what
)
==
TYPE_GARBAGE
)
{
if
(
player
<
1
)
notify_descriptor
(
descr
,
"MPI Error: Garbage trigger."
);
else
notify_nolisten
(
player
,
"MPI Error: Garbage trigger."
,
1
);
mesg_rec_cnt
--
;
outbuf
[
0
]
=
'\0'
;
return
NULL
;
}
strcpy
(
wbuf
,
inbuf
);
for
(
p
=
q
=
0
;
wbuf
[
p
]
&&
(
p
<
maxchars
-
1
)
&&
q
<
(
maxchars
-
1
);
p
++
)
{
if
(
wbuf
[
p
]
==
'\\'
)
{
...
...
@@ -1133,11 +1143,15 @@ mesg_parse(int descr, dbref player, dbref what, dbref perms, const char *inbuf,
return
NULL
;
}
}
else
{
showtextflag
=
1
;
p
=
(
int
)
(
ptr
-
wbuf
);
if
(
q
<
(
maxchars
-
1
))
outbuf
[
q
++
]
=
MFUN_LEADCHAR
;
ptr
=
""
;
/* unknown substitution type */
showtextflag
=
1
;
ptr
--
;
i
=
s
+
1
;
while
(
ptr
&&
*
ptr
&&
i
--
&&
q
<
(
maxchars
-
1
))
{
outbuf
[
q
++
]
=
*
(
ptr
++
);
}
outbuf
[
q
]
=
'\0'
;
p
=
(
int
)
(
ptr
-
wbuf
)
-
1
;
ptr
=
""
;
/* unknown substitution type */
}
while
(
ptr
&&
*
ptr
&&
q
<
(
maxchars
-
1
))
outbuf
[
q
++
]
=
*
(
ptr
++
);
...
...
protomuck/src/p_array.c
View file @
9c21c5f4
...
...
@@ -1988,9 +1988,11 @@ prim_array_interpret(PRIM_PROTOTYPE)
text
=
buf
;
break
;
case
PROG_OBJECT
:
if
(
in
->
data
.
number
==
-
1
)
{
text
=
"*NOTHING*"
;
break
;
}
if
(
in
->
data
.
number
<
-
1
)
{
text
=
"*INVALID*"
;
break
;
}
if
(
in
->
data
.
number
>=
db_top
)
{
text
=
"*INVALID*"
;
break
;
}
if
(
in
->
data
.
number
==
-
1
)
{
text
=
"*NOTHING*"
;
break
;
}
if
(
in
->
data
.
number
==
-
2
)
{
text
=
"*AMBIGUOUS*"
;
break
;
}
if
(
in
->
data
.
number
==
-
3
)
{
text
=
"*HOME*"
;
break
;
}
if
(
in
->
data
.
number
<
-
3
)
{
text
=
"*INVALID*"
;
break
;
}
sprintf
(
buf
,
"%s"
,
NAME
(
in
->
data
.
number
));
text
=
buf
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment