mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-05 23:31:03 +00:00
Allow entity copying too.
This commit is contained in:
parent
1945da99d9
commit
a9987467ec
1 changed files with 25 additions and 0 deletions
|
@ -51,6 +51,31 @@ vec3_t bad_maxs = {8, 8, 8};
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) copyWithZone: (NSZone *) zone
|
||||||
|
{
|
||||||
|
id new, nb;
|
||||||
|
epair_t *e;
|
||||||
|
int i, c;
|
||||||
|
|
||||||
|
new = [[Entity allocWithZone: zone] init];
|
||||||
|
[new setModifiable: modifiable];
|
||||||
|
|
||||||
|
for (e = epairs; e; e = e->next) {
|
||||||
|
// don't copy target and targetname fields
|
||||||
|
if (strncmp (e->key, "target", 6))
|
||||||
|
[new setKey: e->key toValue: e->value];
|
||||||
|
}
|
||||||
|
|
||||||
|
c = [self count];
|
||||||
|
for (i = 0; i < c; i++) {
|
||||||
|
nb = [[self objectAtIndex: i] copy];
|
||||||
|
[nb setParent: new];
|
||||||
|
[new addObject: nb];
|
||||||
|
}
|
||||||
|
|
||||||
|
return new;
|
||||||
|
}
|
||||||
|
|
||||||
- (Entity *) initClass: (const char *)classname
|
- (Entity *) initClass: (const char *)classname
|
||||||
{
|
{
|
||||||
id new;
|
id new;
|
||||||
|
|
Loading…
Reference in a new issue