mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-25 02:41:22 +00:00
Merge pull request #292 from xycaleth/fix-undo-crash
Fix crash when undoing a delete of a misc_model
This commit is contained in:
commit
424958f54b
1 changed files with 15 additions and 2 deletions
|
@ -93,8 +93,21 @@ entity_t *Entity_Clone( entity_t *e ){
|
||||||
n = Entity_Alloc();
|
n = Entity_Alloc();
|
||||||
n->eclass = e->eclass;
|
n->eclass = e->eclass;
|
||||||
|
|
||||||
for ( ep = e->epairs ; ep ; ep = ep->next )
|
for ( ep = e->epairs ; ep ; ep = ep->next ){
|
||||||
SetKeyValue( n, ep->key, ep->value );
|
if ( !ep->key || !ep->key[0] ) {
|
||||||
|
Sys_FPrintf( SYS_ERR, "ERROR: Entity_Clone: NULL or zero-length key\n" );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetKeyValue( n->epairs, ep->key, ep->value );
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( ep = n->epairs ; ep ; ep = ep->next ){
|
||||||
|
/*!
|
||||||
|
\todo TODO broadcast this through a clean messaging API ;-)
|
||||||
|
*/
|
||||||
|
Entity_OnKeyValueChanged( n, ep->key, ep->value );
|
||||||
|
}
|
||||||
|
|
||||||
// copy some misc stuff as well
|
// copy some misc stuff as well
|
||||||
VectorCopy( e->origin, n->origin );
|
VectorCopy( e->origin, n->origin );
|
||||||
|
|
Loading…
Reference in a new issue