mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fixed attachments so that trying to attach a loaded UGL onto a weapon that already has 3 attachments will fail instead of causing an assertion error.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2391 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3501,6 +3501,11 @@ BOOLEAN OBJECTTYPE::AttachObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pAttachme
|
||||
if ((*this)[subObject]->attachments.size() >= MAX_ATTACHMENTS) {
|
||||
return FALSE;
|
||||
}
|
||||
//CHRISL: If we're adding a loaded UGL, then we have to make sure there are actually 2 open attachment slots instead of 1
|
||||
if(Item[pAttachment->usItem].grenadelauncher && (*pAttachment)[0]->attachments.size() > 0) {
|
||||
if ((*this)[subObject]->attachments.size() >= (MAX_ATTACHMENTS-1))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static OBJECTTYPE attachmentObject;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user